feat: add flattenSetList

Using the function reduces continual use of lib.lists.flatten, by
applying it to each of the attributes of a set, assuming they contain lists.
This commit is contained in:
Infinidoge 2021-10-01 18:34:44 -04:00
parent 65dc0e36e4
commit ed97f22ac0
2 changed files with 18 additions and 16 deletions

View file

@ -142,24 +142,25 @@
modules = [ ];
importables = rec {
profiles = digga.lib.rakeLeaves ./users/profiles;
suites = with profiles; rec {
base = [
# Base Configuration
xdg
suites = with profiles; self.lib.flattenSetList
rec {
base = [
# Base Configuration
xdg
# Programs
direnv
git
pass
emacs
gaming
# Programs
direnv
git
pass
emacs
gaming
# Terminal
kitty
starship
shells.all
];
};
# Terminal
kitty
starship
shells.all
];
};
};
users = {
infinidoge = { };

View file

@ -2,5 +2,6 @@
lib.makeExtensible (self:
{
flattenListSet = imports: (lib.lists.flatten (builtins.concatLists (builtins.attrValues imports)));
flattenSetList = attrSet: (builtins.mapAttrs (name: value: lib.lists.flatten value) attrSet);
}
)