From b88fbfbcb9c21698d1b54972812d21034553ee17 Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 16 Feb 2025 20:27:33 -0600 Subject: [PATCH] flake: pass home-manager.lib via specialArgs Signed-off-by: Myned --- flake.in.nix | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/flake.in.nix b/flake.in.nix index f2ad82d..8298a2d 100644 --- a/flake.in.nix +++ b/flake.in.nix @@ -98,28 +98,31 @@ #!! There is no default nixpkgs, inputs.-BRANCH must exist #?? branch = common "BRANCH" "ARCHITECTURE" [ MODULES ] common = branch: arch: modules: - inputs."nixpkgs-${branch}".lib.nixosSystem { - system = arch; - specialArgs = {inherit inputs;}; + with inputs."nixpkgs-${branch}".lib; + nixosSystem { + system = arch; - # TODO: Clean up optional attributes with each new release - #!! Options will diverge between branches over time - #?? with lib; optionalAttrs (versionAtLeast version "VERSION") { ... }; - modules = - modules - ++ [ - ./options - ./configuration.nix + specialArgs = { + inherit inputs; - #!! Avoid globally importing modules that are not guarded by .enable - # https://github.com/NixOS/nixpkgs/issues/137168 - ( - { - inputs, - lib, - ... - }: - with lib; { + # Pass home-manager lib through nixpkgs lib + #?? lib.home-manager.* + lib = recursiveUpdate inputs."nixpkgs-${branch}".lib {home-manager = inputs."home-manager-${branch}".lib;}; + }; + + # TODO: Clean up optional attributes with each new release + #!! Options will diverge between branches over time + #?? with lib; optionalAttrs (versionAtLeast version "VERSION") { ... }; + modules = + modules + ++ [ + ./options + ./configuration.nix + + #!! Avoid globally importing modules that are not guarded by .enable + # https://github.com/NixOS/nixpkgs/issues/137168 + ( + {inputs, ...}: { imports = [ inputs."aagl-gtk-on-nix-${branch}".nixosModules.default @@ -175,9 +178,9 @@ inputs."nixgl-${branch}".overlays.default ]; } - ) - ]; - }; + ) + ]; + }; #?? system = branch "ARCHITECTURE" [ MODULES ] stable = arch: modules: common "stable" "${arch}-linux" modules;