1
1
Fork 0

flake: pass home-manager.lib via specialArgs

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2025-02-16 20:27:33 -06:00
parent 180f44de64
commit b88fbfbcb9
Signed by: Myned
GPG key ID: C7224454F7881A34

View file

@ -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;};
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;