KZDKM / Hyprspace

Workspace overview plugin for Hyprland
GNU General Public License v2.0
523 stars 16 forks source link

Build with nix flakes and home-manager -- 'build.ninja': No such file or directory #79

Closed jennydaman closed 2 months ago

jennydaman commented 3 months ago

Hello,

I am trying to add Hyprspace to my home-manager config by following the instructions here: https://github.com/KZDKM/Hyprspace/blob/743ec37d02bb2b7261f28de16bf404cebfd96105/README.md#nix

diff --git a/flake.nix b/flake.nix
index 0360c51..e22be20 100644
--- a/flake.nix
+++ b/flake.nix
@@ -9,6 +9,19 @@
       inputs.nixpkgs.follows = "nixpkgs";
     };
     dovemail.url = "gitlab:jennydaman/dovemail";
+
+    hyprland = {
+      type = "git";
+      url = "https://github.com/hyprwm/Hyprland";
+      submodules = true;
+      inputs.nixpkgs.follows = "nixpkgs";
+    };
+    Hyprspace = {
+      url = "github:KZDKM/Hyprspace";
+
+      # Hyprspace uses latest Hyprland. We declare this to keep them in sync.
+      inputs.hyprland.follows = "hyprland";
+    };
   };

   outputs = { nixpkgs, home-manager, ... } @ inputs:
diff --git a/hyprland/enable.nix b/hyprland/enable.nix
index 1cd210b..8ac7433 100644
--- a/hyprland/enable.nix
+++ b/hyprland/enable.nix
@@ -5,5 +5,6 @@

   wayland.windowManager.hyprland.plugins = with pkgs.hyprlandPlugins; [
     hyprexpo
+    inputs.Hyprspace.packages.${pkgs.system}.Hyprspace
   ];
 }

When I run home-manager switch, I get the following error:

$ home-manager switch   
error: builder for '/nix/store/b0kgm9d1hrwpszaraxdihlrv9afdyi3l-Hyprspace-0.1+date=2024-08-21_743ec37.drv' failed with exit code 1;
       last 10 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/42k1b2398vm4y104cgvwq3gdl5whm7dr-d5fjcz2agqdy9l8gq4zypkna9fx5f1ih-source
       > source root is d5fjcz2agqdy9l8gq4zypkna9fx5f1ih-source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > no configure script, doing nothing
       > Running phase: buildPhase
       > build flags: -j20
       > ninja: error: loading 'build.ninja': No such file or directory
       For full logs, run 'nix-store -l /nix/store/b0kgm9d1hrwpszaraxdihlrv9afdyi3l-Hyprspace-0.1+date=2024-08-21_743ec37.drv'.
error: 1 dependencies of derivation '/nix/store/rpdv33akv2v9mb29r1j8rz7859fqg8r2-hm_hyprhyprland.conf.drv' failed to build
error: 1 dependencies of derivation '/nix/store/pfq5sp4xx043vfb0z6xhslfr9yz6zw5d-activation-script.drv' failed to build
error: 1 dependencies of derivation '/nix/store/2hr31v7rxmdx6kdvr4cqz6n2mj1vc51s-home-manager-generation.drv' failed to build

$ nix-store -l /nix/store/b0kgm9d1hrwpszaraxdihlrv9afdyi3l-Hyprspace-0.1+date=2024-08-21_743ec37.drv
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/42k1b2398vm4y104cgvwq3gdl5whm7dr-d5fjcz2agqdy9l8gq4zypkna9fx5f1ih-source
source root is d5fjcz2agqdy9l8gq4zypkna9fx5f1ih-source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
no configure script, doing nothing
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
build flags: -j20
ninja: error: loading 'build.ninja': No such file or directory
zkyzx commented 3 months ago

Overriding the package to include meson in nativeBuildInputs seems to work for me.

    wayland.windowManager.hyprland = {
      plugins = [
        # inputs.Hyprspace.packages.${pkgs.system}.Hyprspace
        (inputs.Hyprspace.packages.${pkgs.system}.Hyprspace.overrideAttrs ( finalAttrs: previousAttrs:{
          nativeBuildInputs = with pkgs; [ meson ] ++ previousAttrs.nativeBuildInputs; 
        }))
      ];
r00tr4v3n commented 3 months ago

This builds it but it still fails to load the plugin for me.

zkyzx commented 3 months ago

This builds it but it still fails to load the plugin for me.

Are your flake inputs up to date? What errors are you seeing?

r00tr4v3n commented 2 months ago

It just said failed to load plugin at the top bar.

zkyzx commented 2 months ago

It just said failed to load plugin at the top bar.

Which hyprland version are you using?

My flake uses the package from inputs.hyprland ( hyprland git ).

wayland.windowManager.hyprland.package = inputs.hyprland.packages.${pkgs.system}.hyprland;
r00tr4v3n commented 2 months ago

I used your readme for the setup but I must have messed it up somehow. Since I did not safe the changes there is no point in searching for the error till the next try. Thank you.