From 09f085bad784c1dbe8597421205a53dfdc1f61ae Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 27 Oct 2024 19:20:18 -0700 Subject: [PATCH 1/3] nix: overlays: remove mkJoinedOverlays function Closes #285 I introuced `mkJoinedOverlays` long ago, but we can use `lib.composeManyExtensions` instead. I am happy to remove it! --- nix/overlays.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nix/overlays.nix b/nix/overlays.nix index 9496a05..4287eee 100644 --- a/nix/overlays.nix +++ b/nix/overlays.nix @@ -5,9 +5,6 @@ }: let ver = lib.removeSuffix "\n" (builtins.readFile ../VERSION); - mkJoinedOverlays = overlays: final: prev: - lib.foldl' (attrs: overlay: attrs // (overlay final prev)) {} overlays; - mkDate = longDate: (lib.concatStringsSep "-" [ (builtins.substring 0 4 longDate) (builtins.substring 4 2 longDate) @@ -16,7 +13,7 @@ version = ver + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); in { - default = mkJoinedOverlays (with self.overlays; [ + default = lib.composeManyExtensions (with self.overlays; [ xdg-desktop-portal-hyprland inputs.hyprlang.overlays.default inputs.hyprland-protocols.overlays.default From 99fbdc65320090cc16a3fae691a56994103e30ec Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 27 Oct 2024 19:23:56 -0700 Subject: [PATCH 2/3] nix: overlays: remove needless with --- nix/overlays.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/overlays.nix b/nix/overlays.nix index 4287eee..d54385e 100644 --- a/nix/overlays.nix +++ b/nix/overlays.nix @@ -13,14 +13,14 @@ version = ver + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); in { - default = lib.composeManyExtensions (with self.overlays; [ - xdg-desktop-portal-hyprland + default = lib.composeManyExtensions [ + self.overlays.xdg-desktop-portal-hyprland inputs.hyprlang.overlays.default inputs.hyprland-protocols.overlays.default inputs.hyprutils.overlays.default inputs.hyprwayland-scanner.overlays.default self.overlays.sdbus-cpp_2 - ]); + ]; xdg-desktop-portal-hyprland = lib.composeManyExtensions [ (final: prev: { From aa6359242be9b257e4265cbbe11f92a0222a8b60 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Sun, 27 Oct 2024 19:26:16 -0700 Subject: [PATCH 3/3] nix: overlays: default: change composition order --- nix/overlays.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nix/overlays.nix b/nix/overlays.nix index d54385e..fe7870f 100644 --- a/nix/overlays.nix +++ b/nix/overlays.nix @@ -13,13 +13,14 @@ version = ver + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); in { + # List dependencies in ascending order with respect to usage (`foldr`). default = lib.composeManyExtensions [ self.overlays.xdg-desktop-portal-hyprland - inputs.hyprlang.overlays.default + self.overlays.sdbus-cpp_2 inputs.hyprland-protocols.overlays.default - inputs.hyprutils.overlays.default inputs.hyprwayland-scanner.overlays.default - self.overlays.sdbus-cpp_2 + inputs.hyprlang.overlays.default + inputs.hyprutils.overlays.default ]; xdg-desktop-portal-hyprland = lib.composeManyExtensions [