From 4f9cf5ba71b14e8f8a3dc67cafb00a7ba6f8ffa1 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Thu, 2 May 2024 15:51:30 -0700 Subject: [PATCH 1/3] flake: overlay: fix infrec My last PR fixed the issue that `callPackage` was being used from `prev`, which would mean that all of the arguments it passes to the expression are also going to be from `prev`. This would have been wrong, so I fixed it to get dependencies from `final`, except that I missed `waybar` which does need to come from `prev`. --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index ebaeb81f1..0f7ff1970 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,7 @@ overlays.default = final: prev: { waybar = final.callPackage ./nix/default.nix { + waybar = prev.waybar; # take the first "version: '...'" from meson.build version = (builtins.head (builtins.split "'" From 398cd8cbd42eae063d40c8051cc5d48ed6d98f9d Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Thu, 2 May 2024 15:55:48 -0700 Subject: [PATCH 2/3] flake: packages: inherit from overlay application --- flake.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 0f7ff1970..b5f5470d8 100644 --- a/flake.nix +++ b/flake.nix @@ -59,10 +59,9 @@ }; }; - packages = genSystems (pkgs: - let packages = self.overlays.default pkgs pkgs; - in packages // { - default = packages.waybar; - }); + packages = genSystems (pkgs: { + default = self.packages.${pkgs.stdenv.hostPlatform.system}.waybar; + inherit (pkgs) waybar; + }); }; } From 0141ce5660b74470c53e81ac42d758e18a01c3fc Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Thu, 2 May 2024 15:58:19 -0700 Subject: [PATCH 3/3] flake: overlays: also export named waybar --- flake.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index b5f5470d8..1ef5b09c5 100644 --- a/flake.nix +++ b/flake.nix @@ -46,16 +46,19 @@ }; }); - overlays.default = final: prev: { - waybar = final.callPackage ./nix/default.nix { - waybar = prev.waybar; - # take the first "version: '...'" from meson.build - version = - (builtins.head (builtins.split "'" - (builtins.elemAt - (builtins.split " version: '" (builtins.readFile ./meson.build)) - 2))) - + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); + overlays = { + default = self.overlays.waybar; + waybar = final: prev: { + waybar = final.callPackage ./nix/default.nix { + waybar = prev.waybar; + # take the first "version: '...'" from meson.build + version = + (builtins.head (builtins.split "'" + (builtins.elemAt + (builtins.split " version: '" (builtins.readFile ./meson.build)) + 2))) + + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); + }; }; };