make systemProfiles an attrset

This commit is contained in:
xunuwu 2025-06-06 12:01:12 +02:00
parent 8e45ad0537
commit f44f1a3a46
Signed by: xun
SSH key fingerprint: SHA256:Uot/1WoAjWAeqLOHA5vYy4phhVydsH7jCPmBjaPZfgI
4 changed files with 77 additions and 70 deletions

View file

@ -5,7 +5,15 @@
nixpkgs, nixpkgs,
... ...
} @ inputs: let } @ 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; homeProfiles = ./home;
vars = import ./vars; vars = import ./vars;
l = nixpkgs.lib; l = nixpkgs.lib;

View file

@ -29,25 +29,25 @@
}; };
} }
] ]
++ (map (x: systemProfiles + x) [ ++ (with systemProfiles; [
/programs/home-manager.nix programs.home-manager
/core/security.nix core.security
/core/locale.nix core.locale
/core/tools.nix core.tools
/core/ssh.nix core.ssh
/core/deploy.nix core.deploy
/hardware/graphics.nix hardware.graphics
/hardware/steam-hardware.nix hardware.steam-hardware
/hardware/bluetooth.nix hardware.bluetooth
/nix/nix.nix nix.nix
/nix/gc.nix nix.gc
/network/tailscale.nix network.tailscale
/network/avahi.nix network.avahi
/network/networkd.nix network.networkd
]); ]);
nixpkgs.config = { nixpkgs.config = {

View file

@ -6,7 +6,6 @@
specialArgs, specialArgs,
... ...
}: { }: {
# imports = with systemProfiles; [
imports = imports =
[ [
./hardware.nix ./hardware.nix
@ -31,64 +30,64 @@
}; };
} }
] ]
++ (map (x: systemProfiles + x) [ ++ (with systemProfiles; [
/core/security.nix core.security
/core/keyring.nix core.keyring
/core/users.nix core.users
/core/ssh.nix core.ssh
/core/locale.nix core.locale
/programs/zsh.nix programs.zsh
/programs/fish.nix programs.fish
/core/tools.nix core.tools
/core/compat.nix core.compat
/core/boot.nix core.boot
# core.docs # core.docs
/core/gvfs.nix core.gvfs
/nix/nix.nix nix.nix
/nix/gc.nix nix.gc
/hardware/graphics.nix hardware.graphics
/hardware/steam-hardware.nix hardware.steam-hardware
/hardware/bluetooth.nix hardware.bluetooth
/hardware/qmk.nix hardware.qmk
/network/networkd.nix network.networkd
/network/avahi.nix network.avahi
/network/localsend.nix network.localsend
/network/tailscale.nix network.tailscale
/network/goldberg.nix network.goldberg
/desktop/sway.nix desktop.sway
/programs/dconf.nix programs.dconf
/programs/fonts.nix programs.fonts
/programs/home-manager.nix programs.home-manager
# programs.qt # programs.qt
/programs/adb.nix programs.adb
/programs/openrgb.nix programs.openrgb
/programs/tools.nix programs.tools
/programs/thunar.nix programs.thunar
/services/psd.nix services.psd
/services/dbus-broker.nix services.dbus-broker
/services/pipewire.nix services.pipewire
/services/podman.nix services.podman
/services/flatpak.nix services.flatpak
# services.syncthing # services.syncthing
/services/waydroid.nix services.waydroid
/services/virt-manager.nix services.virt-manager
/services/sunshine.nix services.sunshine
/services/locate.nix services.locate
# network.wifi # network.wifi
/themes/dark.nix themes.dark
/programs/gamemode.nix programs.gamemode
/programs/gamescope.nix programs.gamescope
/programs/steam.nix programs.steam
/programs/reverse-engineering.nix programs.reverse-engineering
]); ]);
services.locate.prunePaths = lib.mkOptionDefault ["/home/xun/backup"]; services.locate.prunePaths = lib.mkOptionDefault ["/home/xun/backup"];

View file

@ -14,16 +14,16 @@
./profiles/backups.nix ./profiles/backups.nix
./profiles/caddy.nix ./profiles/caddy.nix
] ]
++ (map (x: systemProfiles + x) [ ++ (with systemProfiles; [
/core/security.nix core.security
/core/tools.nix core.tools
/core/ssh.nix core.ssh
/core/deploy.nix core.deploy
/nix/default.nix nix.nix
/network/tailscale.nix network.tailscale
/network/networkd.nix network.networkd
]); ]);
boot.loader.grub = { boot.loader.grub = {