From 962224a669046efef9b04a4864118001128bcd7a Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Sun, 27 Oct 2024 09:31:41 +0100 Subject: [PATCH] fix: clean up flake.nix, move package.nix to flake.nix (#30) Cleans up the flake.nix and moves the pakckage.nix into flake.nix due to it being so small --- flake.nix | 39 +++++++++++++++++++++++++++++++-------- nix/package.nix | 29 ----------------------------- 2 files changed, 31 insertions(+), 37 deletions(-) delete mode 100644 nix/package.nix diff --git a/flake.nix b/flake.nix index 60aed1e..b7393b7 100644 --- a/flake.nix +++ b/flake.nix @@ -12,15 +12,38 @@ ... } @ inputs: let systems = ["x86_64-linux"]; - forAllSystems = nixpkgs.lib.genAttrs systems; - packagesForEach = nixpkgs.legacyPackages; + eachSystem = nixpkgs.lib.genAttrs systems; + pkgsFor = nixpkgs.legacyPackages; in { - packages = forAllSystems (system: rec { - default = hypr-dynamic-cursors; - hypr-dynamic-cursors = packagesForEach.${system}.callPackage ./nix/package.nix { - inherit inputs; - pkgs = packagesForEach.${system}; - }; + packages = eachSystem (system: { + default = self.packages.${system}.hypr-dynamic-cursors; + hypr-dynamic-cursors = let + inherit (inputs.hyprland.packages.${system}) hyprland; + inherit (pkgsFor.${system}) stdenvNoCC gcc13; + + name = "hypr-dynamic-cursors"; + in + stdenvNoCC.mkDerivation { + inherit name; + src = ./.; + + inherit (hyprland) buildInputs; + nativeBuildInputs = hyprland.nativeBuildInputs ++ [hyprland gcc13]; + + dontUseCmakeConfigure = true; + dontUseMesonConfigure = true; + dontUseNinjaBuild = true; + dontUseNinjaInstall = true; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/lib" + cp -r out/* "$out/lib/lib${name}.so" + + runHook postInstall + ''; + }; }); }; } diff --git a/nix/package.nix b/nix/package.nix deleted file mode 100644 index 6f7a28b..0000000 --- a/nix/package.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - inputs, - pkgs, -}: let - inherit (inputs.hyprland.packages.${pkgs.system}) hyprland; - inherit (hyprland) buildInputs nativeBuildInputs; - inherit (pkgs) stdenvNoCC gcc13; - - name = "hypr-dynamic-cursors"; -in - stdenvNoCC.mkDerivation { - inherit name buildInputs; - src = ./..; - nativeBuildInputs = nativeBuildInputs ++ [hyprland gcc13]; - - dontUseCmakeConfigure = true; - dontUseMesonConfigure = true; - dontUseNinjaBuild = true; - dontUseNinjaInstall = true; - - installPhase = '' - runHook preInstall - - mkdir -p "$out/lib" - cp -r out/* "$out/lib/lib${name}.so" - - runHook postInstall - ''; - }