mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-17 10:35:13 -05:00
refactor: condensed the lists
This commit is contained in:
parent
d369bfaa5c
commit
98795adb7d
1 changed files with 46 additions and 44 deletions
|
@ -1,9 +1,20 @@
|
||||||
let
|
let
|
||||||
serviceModules = [
|
modulesPath = ./modules;
|
||||||
"services"
|
|
||||||
];
|
|
||||||
|
|
||||||
fileModules = [
|
importFolder = name: {"${name}" = import (modulesPath + "/${name}");};
|
||||||
|
importFile = name: {"${name}" = import (modulesPath + "/${name}.nix");};
|
||||||
|
|
||||||
|
modules =
|
||||||
|
builtins.foldl' (
|
||||||
|
emptySet: importedModules:
|
||||||
|
emptySet // importedModules
|
||||||
|
) {} (map importFolder [
|
||||||
|
"services"
|
||||||
|
])
|
||||||
|
// builtins.foldl' (
|
||||||
|
emptySet: importedModules:
|
||||||
|
emptySet // importedModules
|
||||||
|
) {} (map importFile [
|
||||||
"accounts"
|
"accounts"
|
||||||
"android"
|
"android"
|
||||||
"audio"
|
"audio"
|
||||||
|
@ -38,16 +49,7 @@ let
|
||||||
"system"
|
"system"
|
||||||
"virtualization"
|
"virtualization"
|
||||||
"xserver"
|
"xserver"
|
||||||
];
|
]);
|
||||||
|
|
||||||
modulesPath = ./modules;
|
|
||||||
|
|
||||||
importFolder = name: {"${name}" = import (modulesPath + "/${name}");};
|
|
||||||
importFile = name: {"${name}" = import (modulesPath + "/${name}.nix");};
|
|
||||||
|
|
||||||
modules =
|
|
||||||
builtins.foldl' (a: b: a // b) {} (map importFolder serviceModules)
|
|
||||||
// builtins.foldl' (a: b: a // b) {} (map importFile fileModules);
|
|
||||||
in {
|
in {
|
||||||
flake.nixosModules = {
|
flake.nixosModules = {
|
||||||
personal = {
|
personal = {
|
||||||
|
@ -74,7 +76,7 @@ in {
|
||||||
desktop = {
|
desktop = {
|
||||||
imports = with modules; [
|
imports = with modules; [
|
||||||
syncthing
|
syncthing
|
||||||
ollama
|
# ollama
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue