diff --git a/flake.nix b/flake.nix index 53eff15..8671fea 100644 --- a/flake.nix +++ b/flake.nix @@ -5,7 +5,15 @@ nixpkgs, ... } @ inputs: let - systemProfiles = ./sys/profiles; + _loadProfiles = dir: + b.readDir dir + |> b.mapAttrs (categoryName: _: + b.readDir /${dir}/${categoryName} + |> l.mapAttrs' (profileName: _: { + name = l.removeSuffix ".nix" profileName; + value = /${dir}/${categoryName}/${profileName}; + })); + systemProfiles = _loadProfiles ./sys/profiles; homeProfiles = ./home; vars = import ./vars; l = nixpkgs.lib; diff --git a/hosts/hopper/default.nix b/hosts/hopper/default.nix index c5d7f0b..1d4a01f 100644 --- a/hosts/hopper/default.nix +++ b/hosts/hopper/default.nix @@ -29,25 +29,25 @@ }; } ] - ++ (map (x: systemProfiles + x) [ - /programs/home-manager.nix + ++ (with systemProfiles; [ + programs.home-manager - /core/security.nix - /core/locale.nix - /core/tools.nix - /core/ssh.nix - /core/deploy.nix + core.security + core.locale + core.tools + core.ssh + core.deploy - /hardware/graphics.nix - /hardware/steam-hardware.nix - /hardware/bluetooth.nix + hardware.graphics + hardware.steam-hardware + hardware.bluetooth - /nix/nix.nix - /nix/gc.nix + nix.nix + nix.gc - /network/tailscale.nix - /network/avahi.nix - /network/networkd.nix + network.tailscale + network.avahi + network.networkd ]); nixpkgs.config = { diff --git a/hosts/nixdesk/default.nix b/hosts/nixdesk/default.nix index 7d0c12b..40bb650 100644 --- a/hosts/nixdesk/default.nix +++ b/hosts/nixdesk/default.nix @@ -6,7 +6,6 @@ specialArgs, ... }: { - # imports = with systemProfiles; [ imports = [ ./hardware.nix @@ -31,64 +30,64 @@ }; } ] - ++ (map (x: systemProfiles + x) [ - /core/security.nix - /core/keyring.nix - /core/users.nix - /core/ssh.nix - /core/locale.nix - /programs/zsh.nix - /programs/fish.nix - /core/tools.nix - /core/compat.nix - /core/boot.nix + ++ (with systemProfiles; [ + core.security + core.keyring + core.users + core.ssh + core.locale + programs.zsh + programs.fish + core.tools + core.compat + core.boot # core.docs - /core/gvfs.nix + core.gvfs - /nix/nix.nix - /nix/gc.nix + nix.nix + nix.gc - /hardware/graphics.nix - /hardware/steam-hardware.nix - /hardware/bluetooth.nix - /hardware/qmk.nix + hardware.graphics + hardware.steam-hardware + hardware.bluetooth + hardware.qmk - /network/networkd.nix - /network/avahi.nix - /network/localsend.nix - /network/tailscale.nix - /network/goldberg.nix + network.networkd + network.avahi + network.localsend + network.tailscale + network.goldberg - /desktop/sway.nix + desktop.sway - /programs/dconf.nix - /programs/fonts.nix - /programs/home-manager.nix + programs.dconf + programs.fonts + programs.home-manager # programs.qt - /programs/adb.nix - /programs/openrgb.nix - /programs/tools.nix - /programs/thunar.nix + programs.adb + programs.openrgb + programs.tools + programs.thunar - /services/psd.nix - /services/dbus-broker.nix - /services/pipewire.nix - /services/podman.nix - /services/flatpak.nix + services.psd + services.dbus-broker + services.pipewire + services.podman + services.flatpak # services.syncthing - /services/waydroid.nix - /services/virt-manager.nix - /services/sunshine.nix - /services/locate.nix + services.waydroid + services.virt-manager + services.sunshine + services.locate # network.wifi - /themes/dark.nix + themes.dark - /programs/gamemode.nix - /programs/gamescope.nix - /programs/steam.nix - /programs/reverse-engineering.nix + programs.gamemode + programs.gamescope + programs.steam + programs.reverse-engineering ]); services.locate.prunePaths = lib.mkOptionDefault ["/home/xun/backup"]; diff --git a/hosts/rackserv/default.nix b/hosts/rackserv/default.nix index 25c21c2..43194d0 100644 --- a/hosts/rackserv/default.nix +++ b/hosts/rackserv/default.nix @@ -14,16 +14,16 @@ ./profiles/backups.nix ./profiles/caddy.nix ] - ++ (map (x: systemProfiles + x) [ - /core/security.nix - /core/tools.nix - /core/ssh.nix - /core/deploy.nix + ++ (with systemProfiles; [ + core.security + core.tools + core.ssh + core.deploy - /nix/default.nix + nix.nix - /network/tailscale.nix - /network/networkd.nix + network.tailscale + network.networkd ]); boot.loader.grub = {