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,59 +1,73 @@
|
||||||
let
|
let
|
||||||
modulesPath = ./modules;
|
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 =
|
modules =
|
||||||
builtins.foldl' (
|
builtins.foldl' (
|
||||||
emptySet: importedModules:
|
emptySet: importedModules:
|
||||||
emptySet // importedModules
|
emptySet // importedModules
|
||||||
) {} (map importFolder [
|
) {} (map
|
||||||
"bat"
|
(name: {
|
||||||
"firefox"
|
"${name}" =
|
||||||
"obs-studio"
|
import (modulesPath
|
||||||
"qbittorrent"
|
+ "/${name}");
|
||||||
"steam"
|
})
|
||||||
])
|
[
|
||||||
|
"bat"
|
||||||
|
"firefox"
|
||||||
|
"obs-studio"
|
||||||
|
"qbittorrent"
|
||||||
|
"steam"
|
||||||
|
])
|
||||||
// builtins.foldl' (
|
// builtins.foldl' (
|
||||||
emptySet: importedModules:
|
emptySet: importedModules:
|
||||||
emptySet // importedModules
|
emptySet // importedModules
|
||||||
) {} (map importFile [
|
) {} (map
|
||||||
"bottom"
|
(name: {
|
||||||
"brave"
|
"${name}" =
|
||||||
"direnv"
|
import (modulesPath
|
||||||
"freetube"
|
+ "/${name}.nix");
|
||||||
"git"
|
})
|
||||||
"helix"
|
[
|
||||||
"home-manager"
|
"bottom"
|
||||||
"lazygit"
|
"brave"
|
||||||
"mpv"
|
"direnv"
|
||||||
"nextcloud"
|
"freetube"
|
||||||
"nushell"
|
"git"
|
||||||
"starship"
|
"helix"
|
||||||
"vscode"
|
"home-manager"
|
||||||
"wezterm"
|
"lazygit"
|
||||||
"yazi"
|
"mpv"
|
||||||
"zellij"
|
"nextcloud"
|
||||||
"zoxide"
|
"nushell"
|
||||||
])
|
"starship"
|
||||||
|
"vscode"
|
||||||
|
"wezterm"
|
||||||
|
"yazi"
|
||||||
|
"zellij"
|
||||||
|
"zoxide"
|
||||||
|
])
|
||||||
// builtins.foldl' (
|
// builtins.foldl' (
|
||||||
emptySet: importedModules:
|
emptySet: importedModules:
|
||||||
emptySet // importedModules
|
emptySet // importedModules
|
||||||
) {} (map importMisc [
|
) {} (map
|
||||||
"android"
|
(name: {
|
||||||
"commandLine"
|
"misc-${name}" =
|
||||||
"desktop"
|
import (modulesPath
|
||||||
"entertainment"
|
+ "/misc/${name}.nix");
|
||||||
"internet"
|
})
|
||||||
"productionArt"
|
[
|
||||||
"productionAudio"
|
"android"
|
||||||
"productionVideo"
|
"commandLine"
|
||||||
"productionWriting"
|
"desktop"
|
||||||
"tracking"
|
"entertainment"
|
||||||
"virtualization"
|
"internet"
|
||||||
]);
|
"productionArt"
|
||||||
|
"productionAudio"
|
||||||
|
"productionVideo"
|
||||||
|
"productionWriting"
|
||||||
|
"tracking"
|
||||||
|
"virtualization"
|
||||||
|
]);
|
||||||
in {
|
in {
|
||||||
flake.homeModules = {
|
flake.homeModules = {
|
||||||
desktop = {
|
desktop = {
|
||||||
|
|
|
@ -1,55 +1,64 @@
|
||||||
let
|
let
|
||||||
modulesPath = ./modules;
|
modulesPath = ./modules;
|
||||||
|
|
||||||
importFolder = name: {"${name}" = import (modulesPath + "/${name}");};
|
|
||||||
importFile = name: {"${name}" = import (modulesPath + "/${name}.nix");};
|
|
||||||
|
|
||||||
modules =
|
modules =
|
||||||
builtins.foldl' (
|
builtins.foldl' (
|
||||||
emptySet: importedModules:
|
emptySet: importedModules:
|
||||||
emptySet // importedModules
|
emptySet // importedModules
|
||||||
) {} (map importFolder [
|
) {} (map
|
||||||
"services"
|
(name: {
|
||||||
])
|
"${name}" =
|
||||||
|
import (modulesPath
|
||||||
|
+ "/${name}");
|
||||||
|
})
|
||||||
|
[
|
||||||
|
"services"
|
||||||
|
])
|
||||||
// builtins.foldl' (
|
// builtins.foldl' (
|
||||||
emptySet: importedModules:
|
emptySet: importedModules:
|
||||||
emptySet // importedModules
|
emptySet // importedModules
|
||||||
) {} (map importFile [
|
) {} (map
|
||||||
"accounts"
|
(name: {
|
||||||
"android"
|
"${name}" =
|
||||||
"audio"
|
import (modulesPath
|
||||||
"bluetooth"
|
+ "/${name}.nix");
|
||||||
"corectrl"
|
})
|
||||||
"dconf"
|
[
|
||||||
"disks"
|
"accounts"
|
||||||
"doas"
|
"android"
|
||||||
"environment"
|
"audio"
|
||||||
"firejail"
|
"bluetooth"
|
||||||
"flatpak"
|
"corectrl"
|
||||||
"fonts"
|
"dconf"
|
||||||
"gnome"
|
"disks"
|
||||||
"greetd"
|
"doas"
|
||||||
"gvfs"
|
"environment"
|
||||||
"home-manager"
|
"firejail"
|
||||||
"locale"
|
"flatpak"
|
||||||
"network"
|
"fonts"
|
||||||
"nix"
|
"gnome"
|
||||||
"nur"
|
"greetd"
|
||||||
"ollama"
|
"gvfs"
|
||||||
"plasma"
|
"home-manager"
|
||||||
"printing"
|
"locale"
|
||||||
"regreet"
|
"network"
|
||||||
"rsyncd"
|
"nix"
|
||||||
"sddm"
|
"nur"
|
||||||
"sops"
|
"ollama"
|
||||||
"ssh"
|
"plasma"
|
||||||
"steam"
|
"printing"
|
||||||
"syncthing"
|
"regreet"
|
||||||
"sysstat"
|
"rsyncd"
|
||||||
"system"
|
"sddm"
|
||||||
"virtualization"
|
"sops"
|
||||||
"xserver"
|
"ssh"
|
||||||
]);
|
"steam"
|
||||||
|
"syncthing"
|
||||||
|
"sysstat"
|
||||||
|
"system"
|
||||||
|
"virtualization"
|
||||||
|
"xserver"
|
||||||
|
]);
|
||||||
in {
|
in {
|
||||||
flake.nixosModules = {
|
flake.nixosModules = {
|
||||||
personal = {
|
personal = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue