mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
home-manager kat user refactor
This commit is contained in:
parent
b1f27aa74d
commit
1230ff387b
13 changed files with 34 additions and 82 deletions
|
|
@ -8,9 +8,9 @@
|
|||
}@args: let
|
||||
colorHelpers = import ./color-helpers.nix { inherit lib; };
|
||||
lib = before // katlib // self;
|
||||
katlib = with before; with katlib; with self;
|
||||
katlib = with before; with katlib; with self;
|
||||
{
|
||||
inherit (colorHelpers) hextorgba;
|
||||
hostImport = import ./host-import.nix { inherit lib; };
|
||||
modList = import ./module-list.nix;
|
||||
modList = import ./module-list.nix { inherit lib; };
|
||||
}; in katlib
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
{ lib }: hostName: lib.filter builtins.pathExists [
|
||||
{ lib }: hostName: with lib; filter builtins.pathExists [
|
||||
(../../config/hosts + "/${hostName}/nixos.nix")
|
||||
(../../config/trusted/hosts + "/${hostName}/nixos.nix")
|
||||
../../config/trusted/profile
|
||||
../../config/profiles/base
|
||||
]
|
||||
] ++ singleton {
|
||||
options.home-manager.users = mkOption {
|
||||
type = types.attrsOf (types.submoduleWith {
|
||||
modules = filter builtins.pathExists [
|
||||
(../../config/hosts + "/${hostName}/home.nix")
|
||||
(../../config/trusted/hosts + "/${hostName}/home.nix")
|
||||
];
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
{ modulesDir, defaultFile ? "default.nix", importAll ? false }:
|
||||
{ lib }: { modulesDir, defaultFile ? "default.nix", importAll ? false }:
|
||||
|
||||
with builtins;
|
||||
|
||||
let
|
||||
isModule = m: lib.isFunction m && (m.isModule or true);
|
||||
filterAttrNamesToList = filter: set:
|
||||
foldl' (a: b: a ++ b) [ ]
|
||||
(map (e: if (filter e set.${e}) then [ e ] else [ ]) (attrNames set));
|
||||
|
|
@ -20,7 +21,7 @@ let
|
|||
in
|
||||
{
|
||||
inherit name;
|
||||
value = if (isFunction m) && !importAll then value else m;
|
||||
value = if lib.isFunction m && ! isModule m then m { inherit lib; } else if isModule m && !importAll then value else m;
|
||||
})
|
||||
files;
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue