mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-17 02:25:12 -05:00
refactor: complete overhaul
This commit is contained in:
parent
fb3e6fed86
commit
0541b3d61f
154 changed files with 936 additions and 904 deletions
|
@ -1,68 +1,38 @@
|
|||
let
|
||||
modulesPath = ./modules;
|
||||
miscPath = modulesPath + "/misc";
|
||||
|
||||
moduleImport = path: nameTransform:
|
||||
builtins.listToAttrs (
|
||||
map
|
||||
(name: {
|
||||
name = nameTransform name;
|
||||
value = import (path + "/${name}");
|
||||
})
|
||||
(
|
||||
builtins.filter
|
||||
(name: (builtins.readDir path).${name} == "regular" && builtins.match ".*\\.nix$" name != null)
|
||||
(builtins.attrNames (builtins.readDir path))
|
||||
)
|
||||
);
|
||||
|
||||
modules =
|
||||
builtins.foldl' (
|
||||
emptySet: importedModules:
|
||||
emptySet // importedModules
|
||||
) {} (map
|
||||
(name: {
|
||||
"${name}" = import (modulesPath + "/${name}");
|
||||
})
|
||||
[
|
||||
"bat"
|
||||
"firefox"
|
||||
"obs-studio"
|
||||
"steam"
|
||||
])
|
||||
// builtins.foldl' (
|
||||
emptySet: importedModules:
|
||||
emptySet // importedModules
|
||||
) {} (map
|
||||
(name: {
|
||||
"${name}" = import (modulesPath + "/${name}.nix");
|
||||
})
|
||||
[
|
||||
"bottom"
|
||||
"brave"
|
||||
"direnv"
|
||||
"fastfetch"
|
||||
"flameshot"
|
||||
"freetube"
|
||||
"git"
|
||||
"helix"
|
||||
"home-manager"
|
||||
"lazygit"
|
||||
"mpv"
|
||||
"nextcloud"
|
||||
"nushell"
|
||||
"starship"
|
||||
"vscode"
|
||||
"wezterm"
|
||||
"yazi"
|
||||
"yt-dlp"
|
||||
"zellij"
|
||||
"zoxide"
|
||||
])
|
||||
// builtins.foldl' (
|
||||
emptySet: importedModules:
|
||||
emptySet // importedModules
|
||||
) {} (map
|
||||
(name: {
|
||||
"misc-${name}" = import (modulesPath + "/misc/${name}.nix");
|
||||
})
|
||||
[
|
||||
"android"
|
||||
"commandLine"
|
||||
"desktop"
|
||||
"entertainment"
|
||||
"internet"
|
||||
"productionArt"
|
||||
"productionAudio"
|
||||
"productionVideo"
|
||||
"productionWriting"
|
||||
"tracking"
|
||||
]);
|
||||
moduleImport modulesPath (name: builtins.replaceStrings [".nix"] [""] name)
|
||||
// moduleImport miscPath (name: "misc-${builtins.replaceStrings [".nix"] [""] name}")
|
||||
// (path:
|
||||
builtins.listToAttrs (
|
||||
map
|
||||
(name: {
|
||||
name = name;
|
||||
value = import (path + "/${name}");
|
||||
})
|
||||
(
|
||||
builtins.filter
|
||||
(name: (builtins.readDir path).${name} == "directory" && name != "misc")
|
||||
(builtins.attrNames (builtins.readDir path))
|
||||
)
|
||||
))
|
||||
modulesPath;
|
||||
in {
|
||||
flake.homeModules = {
|
||||
desktop = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue