mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 10:05:13 -05:00
refactor: cleaned up nixos dir
This commit is contained in:
parent
89814be57c
commit
2000adb56a
77 changed files with 422 additions and 464 deletions
148
nixos/default.nix
Executable file → Normal file
148
nixos/default.nix
Executable file → Normal file
|
@ -1,66 +1,38 @@
|
|||
let
|
||||
modulesPath = ./modules;
|
||||
moduleImport =
|
||||
path: nameTransform:
|
||||
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
|
||||
(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)
|
||||
// (
|
||||
path:
|
||||
builtins.listToAttrs (
|
||||
map
|
||||
(name: {
|
||||
name = name;
|
||||
value = import (path + "/${name}");
|
||||
})
|
||||
(
|
||||
builtins.filter (name: (builtins.readDir path).${name} == "directory") (
|
||||
builtins.attrNames (builtins.readDir path)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
modulesPath;
|
||||
|
||||
modules = directoryImport ./.;
|
||||
in
|
||||
{
|
||||
flake.nixosModules = {
|
||||
personal = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
android
|
||||
audio
|
||||
bluetooth
|
||||
corectrl
|
||||
dconf
|
||||
disks
|
||||
firejail
|
||||
flatpak
|
||||
fonts
|
||||
printing
|
||||
steam
|
||||
sysstat
|
||||
virtualization
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
desktop = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
hypr
|
||||
wayland
|
||||
mullvad
|
||||
syncthing
|
||||
ollama
|
||||
xserver
|
||||
;
|
||||
};
|
||||
};
|
||||
|
@ -68,48 +40,18 @@ in
|
|||
fallaryn = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
plasma
|
||||
sddm
|
||||
tablet
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
plasma = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
plasma
|
||||
sddm
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
gnome = {
|
||||
laptop = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
gnome
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
hyprland = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
hyprland
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
river = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
river
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
wayland = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
wayland
|
||||
xserver
|
||||
;
|
||||
};
|
||||
};
|
||||
|
@ -117,7 +59,18 @@ in
|
|||
server = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
services
|
||||
acme
|
||||
caddy
|
||||
jellyfin
|
||||
logrotate
|
||||
mastodon
|
||||
minecraft
|
||||
ollama
|
||||
website
|
||||
postgresql
|
||||
samba
|
||||
vaultwarden
|
||||
forgejo
|
||||
;
|
||||
};
|
||||
};
|
||||
|
@ -130,20 +83,19 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
shared = {
|
||||
system = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
accounts
|
||||
doas
|
||||
environment
|
||||
gvfs
|
||||
home-manager
|
||||
locale
|
||||
nh
|
||||
nix
|
||||
rsyncd
|
||||
ssh
|
||||
system
|
||||
hardware
|
||||
programs
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
core = {
|
||||
imports = builtins.attrValues {
|
||||
inherit (modules)
|
||||
core
|
||||
xserver
|
||||
;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue