automate the production of profileNames from the folders

This commit is contained in:
kat witch 2021-08-09 23:14:35 +01:00
parent a82f37302a
commit 07461d9b1c
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72

View file

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