flake: pass home-manager.lib via specialArgs
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
180f44de64
commit
b88fbfbcb9
1 changed files with 26 additions and 23 deletions
49
flake.in.nix
49
flake.in.nix
|
@ -98,28 +98,31 @@
|
||||||
#!! There is no default nixpkgs, inputs.<nixpkgs|home-manager>-BRANCH must exist
|
#!! There is no default nixpkgs, inputs.<nixpkgs|home-manager>-BRANCH must exist
|
||||||
#?? branch = common "BRANCH" "ARCHITECTURE" [ MODULES ]
|
#?? branch = common "BRANCH" "ARCHITECTURE" [ MODULES ]
|
||||||
common = branch: arch: modules:
|
common = branch: arch: modules:
|
||||||
inputs."nixpkgs-${branch}".lib.nixosSystem {
|
with inputs."nixpkgs-${branch}".lib;
|
||||||
system = arch;
|
nixosSystem {
|
||||||
specialArgs = {inherit inputs;};
|
system = arch;
|
||||||
|
|
||||||
# TODO: Clean up optional attributes with each new release
|
specialArgs = {
|
||||||
#!! Options will diverge between branches over time
|
inherit inputs;
|
||||||
#?? with lib; optionalAttrs (versionAtLeast version "VERSION") { ... };
|
|
||||||
modules =
|
|
||||||
modules
|
|
||||||
++ [
|
|
||||||
./options
|
|
||||||
./configuration.nix
|
|
||||||
|
|
||||||
#!! Avoid globally importing modules that are not guarded by .enable
|
# Pass home-manager lib through nixpkgs lib
|
||||||
# https://github.com/NixOS/nixpkgs/issues/137168
|
#?? lib.home-manager.*
|
||||||
(
|
lib = recursiveUpdate inputs."nixpkgs-${branch}".lib {home-manager = inputs."home-manager-${branch}".lib;};
|
||||||
{
|
};
|
||||||
inputs,
|
|
||||||
lib,
|
# TODO: Clean up optional attributes with each new release
|
||||||
...
|
#!! Options will diverge between branches over time
|
||||||
}:
|
#?? with lib; optionalAttrs (versionAtLeast version "VERSION") { ... };
|
||||||
with lib; {
|
modules =
|
||||||
|
modules
|
||||||
|
++ [
|
||||||
|
./options
|
||||||
|
./configuration.nix
|
||||||
|
|
||||||
|
#!! Avoid globally importing modules that are not guarded by .enable
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/137168
|
||||||
|
(
|
||||||
|
{inputs, ...}: {
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
inputs."aagl-gtk-on-nix-${branch}".nixosModules.default
|
inputs."aagl-gtk-on-nix-${branch}".nixosModules.default
|
||||||
|
@ -175,9 +178,9 @@
|
||||||
inputs."nixgl-${branch}".overlays.default
|
inputs."nixgl-${branch}".overlays.default
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
#?? system = branch "ARCHITECTURE" [ MODULES ]
|
#?? system = branch "ARCHITECTURE" [ MODULES ]
|
||||||
stable = arch: modules: common "stable" "${arch}-linux" modules;
|
stable = arch: modules: common "stable" "${arch}-linux" modules;
|
||||||
|
|
Loading…
Add table
Reference in a new issue