mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
automate the production of profileNames from the folders
This commit is contained in:
parent
a82f37302a
commit
07461d9b1c
1 changed files with 5 additions and 7 deletions
|
|
@ -9,13 +9,11 @@ let katUser = { lib }: let
|
|||
(./. + "/${profile}")
|
||||
];
|
||||
};
|
||||
}; profileNames = [
|
||||
"gui"
|
||||
"sway"
|
||||
"dev"
|
||||
"media"
|
||||
"personal"
|
||||
]; userProfiles = with userProfiles;
|
||||
}; filterAttrNamesToList = filter: set:
|
||||
lib.foldl' (a: b: a ++ b) [ ]
|
||||
(map (e: if (filter e set.${e}) then [ e ] else [ ]) (lib.attrNames set));
|
||||
profileNames = (filterAttrNamesToList (name: type: name != "base" && type == "directory") (builtins.readDir ./.));
|
||||
userProfiles = with userProfiles;
|
||||
lib.genAttrs profileNames userImport // {
|
||||
base = { imports = [ ./nixos.nix (userImport "base") trustedImport ]; };
|
||||
server = { imports = [ personal ]; };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue