mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-11 14:24:38 -05:00
feat: refactored home manager
This commit is contained in:
parent
65417d1809
commit
376c1d7b18
511 changed files with 1777 additions and 772 deletions
184
home/default.nix
184
home/default.nix
|
@ -1,176 +1,46 @@
|
|||
let
|
||||
modulesPath = ./modules;
|
||||
miscPath = modulesPath + "/misc";
|
||||
# Recursively collect directories
|
||||
collectDirs =
|
||||
path:
|
||||
let
|
||||
content = builtins.readDir path;
|
||||
subdirs = builtins.filter (name: content.${name} == "directory") (builtins.attrNames content);
|
||||
buildPath = name: path + "/${name}";
|
||||
|
||||
moduleImport =
|
||||
path: nameTransform:
|
||||
# Get immediate subdirectories
|
||||
thisDirs = map buildPath subdirs;
|
||||
# Recursively get sub-subdirectories
|
||||
subDirs = builtins.concatMap collectDirs thisDirs;
|
||||
in
|
||||
[ path ] ++ subDirs;
|
||||
|
||||
# Import directories and their default.nix files
|
||||
directoryImport =
|
||||
path:
|
||||
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))
|
||||
)
|
||||
map (dir: {
|
||||
name = baseNameOf (toString dir);
|
||||
value = import dir;
|
||||
}) (collectDirs path)
|
||||
);
|
||||
|
||||
modules =
|
||||
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;
|
||||
# Create the modules attrset
|
||||
modules = directoryImport ./.;
|
||||
in
|
||||
{
|
||||
flake.homeModules = {
|
||||
desktop = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
brave
|
||||
flameshot
|
||||
misc-android
|
||||
misc-desktop
|
||||
misc-internet
|
||||
misc-tracking
|
||||
cli
|
||||
gui
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
entertainment = {
|
||||
server = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
freetube
|
||||
misc-entertainment
|
||||
mpv
|
||||
steam
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
firefox = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
firefox
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
hyprland = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
gtk
|
||||
dunst
|
||||
easyEffects
|
||||
gammastep
|
||||
hyprland
|
||||
misc-hyprland
|
||||
network
|
||||
swaylock
|
||||
tofi
|
||||
waybar
|
||||
;
|
||||
};
|
||||
};
|
||||
productionArt = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
misc-productionArt
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
productionAudio = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
misc-productionAudio
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
productionCode = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
neovim
|
||||
vscode
|
||||
zed
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
productionVideo = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
misc-productionVideo
|
||||
obs-studio
|
||||
yt-dlp
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
productionWriting = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
misc-productionWriting
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
shared = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
bottom
|
||||
direnv
|
||||
fastfetch
|
||||
ghostty
|
||||
git
|
||||
helix
|
||||
homeManager
|
||||
lazygit
|
||||
misc-commandLine
|
||||
nushell
|
||||
starship
|
||||
yazi
|
||||
zellij
|
||||
zoxide
|
||||
cli
|
||||
;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue