WillPower3309 / swayfx

SwayFX: Sway, but with eye candy!
MIT License
1.32k stars 49 forks source link

[Nix] Building from flake fails on latest nixpkgs #313

Closed ProbablyRohan closed 4 months ago

ProbablyRohan commented 5 months ago
         … while evaluating the attribute 'packages.x86_64-linux.swayfx-unwrapped'

         at /nix/store/qddv2lxiznhvicm8b5qrdszq1s35h316-source/flake.nix:16:9:

           15|       mkPackage = pkgs: {
           16|         swayfx-unwrapped =
             |         ^
           17|           (pkgs.swayfx-unwrapped.override { wlroots_0_16 = pkgs.wlroots_0_17; }).overrideAttrs

       … while calling a functor (an attribute set with a '__functor' attribute)

         at /nix/store/qddv2lxiznhvicm8b5qrdszq1s35h316-source/flake.nix:17:12:

           16|         swayfx-unwrapped =
           17|           (pkgs.swayfx-unwrapped.override { wlroots_0_16 = pkgs.wlroots_0_17; }).overrideAttrs
             |            ^
           18|             (old: {

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: function 'anonymous lambda' called with unexpected argument 'wlroots_0_16'

       at /nix/store/6gxrfravwqh3mjfnqvxgrl7hqm9cf3j1-source/pkgs/by-name/sw/swayfx-unwrapped/package.nix:1:1:

            1| {
             | ^
            2|   lib,
ProbablyRohan commented 5 months ago

Sorry accidentally pressed send EDIT: edited issue it's finished now

ProbablyRohan commented 5 months ago

312 seems to fix the issue, I'll close if it gets merged

famfo commented 4 months ago

This doesn't seem to fully fix the error, for me it just changed wlroots_0_16 to wlroots:

error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'home-manager-generation'
         whose name attribute is located at /nix/store/fn37f282c4a6c2620viijmn54hc4d0sb-nixos/nixos/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'

         at /nix/store/fn37f282c4a6c2620viijmn54hc4d0sb-nixos/nixos/pkgs/build-support/trivial-builders/default.nix:68:16:

           67|         enableParallelBuilding = true;
           68|         inherit buildCommand name;
             |                ^
           69|         passAsFile = [ "buildCommand" ]

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: function 'anonymous lambda' called with unexpected argument 'wlroots'

       at /nix/store/3vysbx7v008h7473gwfmv6lzqfzsn3q7-source/pkgs/by-name/sw/swayfx-unwrapped/package.nix:1:1:

            1| {
             | ^
            2|   lib,
ProbablyRohan commented 4 months ago

Try cloning the repo and building it with and without updating inputs see if both of them give the same error

percygt commented 4 months ago

For the meantime, I temporarily override swayfx from nixpkgs-unstable with this. It builds just fine on my machine.

inputs.swayfx = {
      url = "github:WillPower3309/swayfx";
      flake = false;
};
swayfx-unwrapped = (pkgs.swayfx-unwrapped.override {wlroots = pkgs.wlroots_0_17;}).overrideAttrs (old: {
      version = "0.4.0-git";
      src = pkgs.lib.cleanSource inputs.swayfx;
      nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.cmake];
      buildInputs = old.buildInputs ++ [pkgs.scenefx];
});
swayfx = pkgs.swayfx.override {inherit swayfx-unwrapped;};
percygt commented 4 months ago

I just notice #312 is now merged. I think its okay now to make the flake as input like this.

inputs.swayfx.url = "github:WillPower3309/swayfx";
swayfx-unwrapped = inputs.swayfx.packages.${pkgs.system}.default
swayfx = pkgs.swayfx.override {inherit swayfx-unwrapped;};
ProbablyRohan commented 4 months ago

Yeah #312 fixed the issue for me, I’m not sure what could be causing @famfo error, I will try to reproduce it later today

famfo commented 4 months ago

312 actually introduces the error for me. The latest commit that is building is e45b420ccc888f4d14782f233cf037941a2425db.

Cloning from git and doing nix build and trying to build this from my home-manager config fails with that error.

Minimal (channel based) home-manager config:

{ config, pkgs, ... }:

let
  swayfx = (builtins.getFlake "github:WillPower3309/swayfx/aaa3c7536ee8d7e784106809b748497401f3838b").packages.${pkgs.system}.swayfx-unwrapped;
in
{
  wayland.windowManager.sway = {
    enable = true;
    package = swayfx;
  };
}
famfo commented 4 months ago

Looks like my system has an older commit of nixpkgs-ustable cached and refuses to update it, forcing a newer commit fixes the build again.

ProbablyRohan commented 4 months ago

Is your problem all fixed then? If so I'll close the issue unless anyone else has another related error

famfo commented 4 months ago

Yep, it is fixed after updating the flake.