mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 10:05:13 -05:00
refactor: cleaned up folds
This commit is contained in:
parent
a114034e0e
commit
82eeb09127
2 changed files with 108 additions and 85 deletions
|
@ -1,15 +1,17 @@
|
|||
let
|
||||
modulesPath = ./modules;
|
||||
|
||||
importFolder = name: {"${name}" = import (modulesPath + "/${name}");};
|
||||
importFile = name: {"${name}" = import (modulesPath + "/${name}.nix");};
|
||||
importMisc = name: {"misc-${name}" = import (modulesPath + "/misc/${name}.nix");};
|
||||
|
||||
modules =
|
||||
builtins.foldl' (
|
||||
emptySet: importedModules:
|
||||
emptySet // importedModules
|
||||
) {} (map importFolder [
|
||||
) {} (map
|
||||
(name: {
|
||||
"${name}" =
|
||||
import (modulesPath
|
||||
+ "/${name}");
|
||||
})
|
||||
[
|
||||
"bat"
|
||||
"firefox"
|
||||
"obs-studio"
|
||||
|
@ -19,7 +21,13 @@ let
|
|||
// builtins.foldl' (
|
||||
emptySet: importedModules:
|
||||
emptySet // importedModules
|
||||
) {} (map importFile [
|
||||
) {} (map
|
||||
(name: {
|
||||
"${name}" =
|
||||
import (modulesPath
|
||||
+ "/${name}.nix");
|
||||
})
|
||||
[
|
||||
"bottom"
|
||||
"brave"
|
||||
"direnv"
|
||||
|
@ -41,7 +49,13 @@ let
|
|||
// builtins.foldl' (
|
||||
emptySet: importedModules:
|
||||
emptySet // importedModules
|
||||
) {} (map importMisc [
|
||||
) {} (map
|
||||
(name: {
|
||||
"misc-${name}" =
|
||||
import (modulesPath
|
||||
+ "/misc/${name}.nix");
|
||||
})
|
||||
[
|
||||
"android"
|
||||
"commandLine"
|
||||
"desktop"
|
||||
|
|
|
@ -1,20 +1,29 @@
|
|||
let
|
||||
modulesPath = ./modules;
|
||||
|
||||
importFolder = name: {"${name}" = import (modulesPath + "/${name}");};
|
||||
importFile = name: {"${name}" = import (modulesPath + "/${name}.nix");};
|
||||
|
||||
modules =
|
||||
builtins.foldl' (
|
||||
emptySet: importedModules:
|
||||
emptySet // importedModules
|
||||
) {} (map importFolder [
|
||||
) {} (map
|
||||
(name: {
|
||||
"${name}" =
|
||||
import (modulesPath
|
||||
+ "/${name}");
|
||||
})
|
||||
[
|
||||
"services"
|
||||
])
|
||||
// builtins.foldl' (
|
||||
emptySet: importedModules:
|
||||
emptySet // importedModules
|
||||
) {} (map importFile [
|
||||
) {} (map
|
||||
(name: {
|
||||
"${name}" =
|
||||
import (modulesPath
|
||||
+ "/${name}.nix");
|
||||
})
|
||||
[
|
||||
"accounts"
|
||||
"android"
|
||||
"audio"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue