mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 10:05:13 -05:00
refactor: cleaned up nixos and home dirs
This commit is contained in:
parent
2000adb56a
commit
824a91d405
643 changed files with 323 additions and 195 deletions
104
modules/nixos/default.nix
Executable file
104
modules/nixos/default.nix
Executable file
|
@ -0,0 +1,104 @@
|
|||
let
|
||||
collectDirs =
|
||||
path:
|
||||
let
|
||||
content = builtins.readDir path;
|
||||
subdirs = builtins.filter (name: content.${name} == "directory") (builtins.attrNames content);
|
||||
buildPath = name: path + "/${name}";
|
||||
|
||||
thisDirs = map buildPath subdirs;
|
||||
subDirs = builtins.concatMap collectDirs thisDirs;
|
||||
in
|
||||
[ path ] ++ subDirs;
|
||||
|
||||
directoryImport =
|
||||
path:
|
||||
builtins.listToAttrs (
|
||||
map (dir: {
|
||||
name = baseNameOf (toString dir);
|
||||
value = import dir;
|
||||
}) (collectDirs path)
|
||||
);
|
||||
|
||||
modules = directoryImport ./.;
|
||||
in
|
||||
{
|
||||
flake.nixosModules = {
|
||||
desktop = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
mullvad
|
||||
syncthing
|
||||
ollama
|
||||
hypr
|
||||
wayland
|
||||
xserver
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
fallaryn = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
plasma
|
||||
sddm
|
||||
tablet
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
laptop = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
gnome
|
||||
xserver
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
server = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
acme
|
||||
caddy
|
||||
jellyfin
|
||||
logrotate
|
||||
mastodon
|
||||
minecraft
|
||||
ollama
|
||||
website
|
||||
postgresql
|
||||
samba
|
||||
vaultwarden
|
||||
forgejo
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
sops = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
sops
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
system = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
hardware
|
||||
programs
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
core = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
core
|
||||
xserver
|
||||
;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue