refactor(packages): remove if-else hell

This commit is contained in:
2026-05-10 08:37:54 +02:00
parent 251f4d70e1
commit afa7a706de
+117 -142
View File
@@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
pkgs-25-11, # pkgs-25-11,
lib,
gamingSystem, gamingSystem,
workSystem, workSystem,
currentSystemDe, currentSystemDe,
@@ -13,152 +14,126 @@
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
environment.systemPackages = environment.systemPackages = with pkgs;
with pkgs; let
[ hostSystem = pkgs.stdenv.hostPlatform.system;
# CLI utils basePackages = [
appimage-run # CLI utils
bat appimage-run
btop bat
bun btop
busybox bun
distrobox busybox
docker distrobox
dua docker
fd dua
fish fd
fzf fish
gh fzf
git gh
gitlab-ci-local git
gnumake gitlab-ci-local
htop gnumake
jq htop
just jq
killall just
krabby killall
lazygit krabby
nmap lazygit
nodejs nmap
openssl nodejs
openvpn openssl
pinentry-tty openvpn
python3 pinentry-tty
ripgrep python3
sops ripgrep
tree sops
unzip tree
wget unzip
wl-clipboard wget
xwayland-satellite wl-clipboard
zip xwayland-satellite
zoxide zip
zulu zoxide
zulu
# Man pages # Man pages
man-pages man-pages
vim # The only and one great editor vim # The only and one great editor
inputs.nixvim.packages.${stdenv.hostPlatform.system}.default # The only and one great editor improved even further inputs.nixvim.packages.${stdenv.hostPlatform.system}.default # The only and one great editor improved even further
inputs.spotiflac-cli.packages.${stdenv.hostPlatform.system}.default
];
inputs.spotiflac-cli.packages.${stdenv.hostPlatform.system}.default guiPackages = lib.optionals (currentSystemDe != "none") [
] vulkan-tools
++ ( baobab
if currentSystemDe != "none" then bazaar
[ blackbox-terminal
# Video card discord
vulkan-tools firefox
gapless
gnome-boxes
mpv
nautilus
nextcloud-client
obs-studio
ollama
piper
seahorse
telegram-desktop
thunderbird
];
# GUI applications gamingPackages = lib.optionals gamingSystem [
baobab cura-appimage
bazaar heroic
blackbox-terminal mangohud
discord openrgb
firefox prismlauncher
gapless protonplus
gnome-boxes satisfactorymodmanager
mpv arrpc
nautilus ];
nextcloud-client
obs-studio
ollama
piper
seahorse
telegram-desktop
thunderbird
]
else
[ ]
)
++ (
if gamingSystem then
[
cura-appimage
heroic
mangohud
openrgb
prismlauncher
protonplus
satisfactorymodmanager
# Required for Discord RPC workPackages = lib.optionals workSystem [
arrpc android-studio
] ansible
else virt-manager
[ ] ];
)
++ (
if workSystem then
[
android-studio
ansible
virt-manager
]
else
[ ]
)
++ (
if currentSystemDe == "plasma" then
[
kdePackages.wallpaper-engine-plugin
]
else
[ ]
)
++ (
if currentSystemDe == "hyprland" then
[
# Hyprland
brightnessctl
hyprpaper
pamixer
pavucontrol
kdePackages.dolphin
]
else
[ ]
)
++ (
if currentSystemDe == "gnome" then
[
gnome-tweaks
gnomeExtensions.appindicator
gnomeExtensions.caffeine
gnomeExtensions.dash-to-dock
gnomeExtensions.wallpaper-slideshow
]
else
[ ]
)
++ (
if currentSystemDe == "niri" then
[
gnome-keyring
inputs.noctalia.packages.${pkgs.stdenv.hostPlatform.system}.default plasmaPackages = lib.optionals (currentSystemDe == "plasma") [
] kdePackages.wallpaper-engine-plugin
else ];
[ ]
); hyprlandPackages = lib.optionals (currentSystemDe == "hyprland") [
brightnessctl
hyprpaper
pamixer
pavucontrol
kdePackages.dolphin
];
gnomePackages = lib.optionals (currentSystemDe == "gnome") [
gnome-tweaks
gnomeExtensions.appindicator
gnomeExtensions.caffeine
gnomeExtensions.dash-to-dock
gnomeExtensions.wallpaper-slideshow
];
niriPackages = lib.optionals (currentSystemDe == "niri") [
gnome-keyring
inputs.noctalia.packages.${hostSystem}.default
];
in
basePackages
++ guiPackages
++ gamingPackages
++ workPackages
++ plasmaPackages
++ hyprlandPackages
++ gnomePackages
++ niriPackages;
} }