Skip to content

Commit

Permalink
flake: pass home-manager.lib via specialArgs
Browse files Browse the repository at this point in the history
Signed-off-by: Myned <[email protected]>
  • Loading branch information
Myned committed Feb 17, 2025
1 parent 180f44d commit b88fbfb
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions flake.in.nix
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,31 @@
#!! There is no default nixpkgs, inputs.<nixpkgs|home-manager>-BRANCH must exist
#?? branch = common "BRANCH" "ARCHITECTURE" [ MODULES ]
common = branch: arch: modules:
inputs."nixpkgs-${branch}".lib.nixosSystem {
system = arch;
specialArgs = {inherit inputs;};

# 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,
lib,
...
}:
with lib; {
with inputs."nixpkgs-${branch}".lib;
nixosSystem {
system = arch;

specialArgs = {
inherit inputs;

# 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
Expand Down Expand Up @@ -175,9 +178,9 @@
inputs."nixgl-${branch}".overlays.default
];
}
)
];
};
)
];
};

#?? system = branch "ARCHITECTURE" [ MODULES ]
stable = arch: modules: common "stable" "${arch}-linux" modules;
Expand Down

0 comments on commit b88fbfb

Please sign in to comment.