From deb3e1753c67c302067383e172c9689428ee8ae2 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Sun, 2 Mar 2025 19:11:27 +0100 Subject: [PATCH] flake: start transitioning away from `with` --- hosts/hermit/programs.nix | 175 +++++++++++++------------- hosts/temperance/programs.nix | 141 +++++++++++---------- modules/programs/gui/steam.nix | 11 +- modules/style/fonts.nix | 41 +++--- modules/system/hardware/bluetooth.nix | 13 +- modules/system/hardware/cpu/intel.nix | 11 +- modules/system/hardware/graphics.nix | 8 +- modules/user/default.nix | 7 +- modules/user/kakoune/default.nix | 8 +- modules/user/shell/packages.nix | 136 ++++++++++---------- 10 files changed, 281 insertions(+), 270 deletions(-) diff --git a/hosts/hermit/programs.nix b/hosts/hermit/programs.nix index f8789e9..fd9442b 100644 --- a/hosts/hermit/programs.nix +++ b/hosts/hermit/programs.nix @@ -1,88 +1,91 @@ {pkgs, ...}: { - environment.systemPackages = with pkgs; [ - alsa-utils - anki - asciinema - cachix - calc - # calibre - cbonsai - cmus - difftastic - element - element-desktop - emacs30-pgtk - # evince - eza - firefox - fftw - gcc - grc - gparted - git - halloy - helvum - httpie - hyperfine - imagemagick - img2pdf - impala - imv - inetutils - jujutsu - just - jrnl - keepassxc - lazygit - libtool - librewolf - links2 - linuxHeaders - moc - mpv - ncmpcpp - neofetch - networkmanagerapplet - nextcloud-client - nicotine-plus - nil - nitch - swww - microfetch - nmap - pamixer - pavucontrol - pdfarranger - pfetch - pidgin - playerctl - polkit - pulsemixer - python3 - ripgrep - rmpc - signal-desktop - sioyek - smartmontools - taskwarrior3 - taskwarrior-tui - telegram-desktop - texliveFull - tldr - thunderbird - tor-browser - trash-cli - typst - ungoogled-chromium - util-linux - v4l-utils - vesktop - vlc - weechat - wireguard-tools - xournalpp - zapzap - zip - zoxide - ]; + environment.systemPackages = builtins.attrValues { + inherit + (pkgs) + alsa-utils + anki + asciinema + cachix + calc + # calibre + cbonsai + cmus + difftastic + element + element-desktop + emacs30-pgtk + # evince + eza + firefox + fftw + gcc + grc + gparted + git + halloy + helvum + httpie + hyperfine + imagemagick + img2pdf + impala + imv + inetutils + jujutsu + just + jrnl + keepassxc + lazygit + libtool + librewolf + links2 + linuxHeaders + moc + mpv + ncmpcpp + neofetch + networkmanagerapplet + nextcloud-client + nicotine-plus + nil + nitch + swww + microfetch + nmap + pamixer + pavucontrol + pdfarranger + pfetch + pidgin + playerctl + polkit + pulsemixer + python3 + ripgrep + rmpc + signal-desktop + sioyek + smartmontools + taskwarrior3 + taskwarrior-tui + telegram-desktop + texliveFull + tldr + thunderbird + tor-browser + trash-cli + typst + ungoogled-chromium + util-linux + v4l-utils + vesktop + vlc + weechat + wireguard-tools + xournalpp + zapzap + zip + zoxide + ; + }; } diff --git a/hosts/temperance/programs.nix b/hosts/temperance/programs.nix index 3c95917..6fc7521 100644 --- a/hosts/temperance/programs.nix +++ b/hosts/temperance/programs.nix @@ -1,71 +1,74 @@ {pkgs, ...}: { - environment.systemPackages = with pkgs; [ - alsa-utils - anki - asciinema - beets - cachix - calc - difftastic - dnsutils - element-desktop - evince - gcc - gnumake - halloy - helvum - httpie - imagemagick - imhex - img2pdf - impala - imv - inetutils - joplin-desktop - jujutsu - julia - just - keepassxc - lazygit - librewolf - libtool - logiops - mpv - nextcloud-client - nheko - nicotine-plus - swww - pandoc - pavucontrol - pdfarranger - picard - polkit - pulsemixer - python3 - pwvucontrol - qbittorrent - r2modman - radare2 - ripgrep - rmpc - signal-desktop - strawberry - telegram-desktop - texliveFull - thunderbird - tor-browser - trash-cli - tutanota-desktop - typst - walker - wayneko - wineWowPackages.waylandFull - wireguard-tools - xdg-utils - xournalpp - zapzap - zathura - zotero - zoxide - ]; + environment.systemPackages = builtins.attrValues { + inherit + (pkgs) + alsa-utils + anki + asciinema + beets + cachix + calc + cinny-desktop + difftastic + dnsutils + element-desktop + evince + gcc + gnumake + halloy + helvum + httpie + imagemagick + imhex + img2pdf + impala + imv + inetutils + joplin-desktop + jujutsu + julia + just + keepassxc + lazygit + librewolf + libtool + logiops + mpv + nextcloud-client + nheko + nicotine-plus + swww + pandoc + pavucontrol + pdfarranger + picard + polkit + pulsemixer + python3 + pwvucontrol + qbittorrent + r2modman + radare2 + ripgrep + rmpc + signal-desktop + strawberry + telegram-desktop + texliveFull + thunderbird + tor-browser + trash-cli + tutanota-desktop + typst + walker + wayneko + wireguard-tools + xdg-utils + xournalpp + zapzap + zathura + zotero + zoxide + ; + }; } diff --git a/modules/programs/gui/steam.nix b/modules/programs/gui/steam.nix index 5b62849..a027f0f 100644 --- a/modules/programs/gui/steam.nix +++ b/modules/programs/gui/steam.nix @@ -3,8 +3,8 @@ lib, pkgs, ... -}: -with lib; let +}: let + inherit (lib) mkIf; cfg = config.modules.system.programs.steam; in { config = mkIf cfg.enable { @@ -17,10 +17,11 @@ in { }; extraLibraries = p: - with p; [ - atk - ]; + builtins.attrValues { + inherit (p) atk; + }; }; + gamescopeSession.enable = true; extraCompatPackages = [pkgs.proton-ge-bin.steamcompattool]; }; diff --git a/modules/style/fonts.nix b/modules/style/fonts.nix index 2b63aae..694731a 100644 --- a/modules/style/fonts.nix +++ b/modules/style/fonts.nix @@ -47,24 +47,29 @@ in { monospace = ["Iosevka Nerd Font"]; }; }; - packages = with pkgs; [ - # custom-iosevka - material-icons - material-design-icons - papirus-icon-theme - nerd-fonts.iosevka - nerd-fonts.jetbrains-mono - nerd-fonts.comic-shanns-mono - nerd-fonts.symbols-only - - lexend - noto-fonts - noto-fonts-cjk-sans - noto-fonts-cjk-serif - noto-fonts-color-emoji - corefonts - font-awesome - ]; + packages = builtins.attrValues { + inherit + (pkgs) + # custom-iosevka + material-icons + material-design-icons + papirus-icon-theme + lexend + noto-fonts + noto-fonts-cjk-sans + noto-fonts-cjk-serif + noto-fonts-color-emoji + corefonts + font-awesome + ; + inherit + (pkgs.nerd-fonts) + iosevka + jetbrains-mono + comic-shanns-mono + symbols-only + ; + }; fontDir = { # Whether to create a directory with links to all fonts in # /run/current-system/sw/share/X11/fonts diff --git a/modules/system/hardware/bluetooth.nix b/modules/system/hardware/bluetooth.nix index 918d4b1..6ef8d98 100644 --- a/modules/system/hardware/bluetooth.nix +++ b/modules/system/hardware/bluetooth.nix @@ -12,10 +12,13 @@ in { enable = true; powerOnBoot = mkIf cfg.powerOnBoot true; }; - environment.systemPackages = with pkgs; [ - bluetuith - bluez - blueman - ]; + environment.systemPackages = builtins.attrValues { + inherit + (pkgs) + bluetuith + bluez + blueman + ; + }; }; } diff --git a/modules/system/hardware/cpu/intel.nix b/modules/system/hardware/cpu/intel.nix index 5495e13..c9a5f23 100644 --- a/modules/system/hardware/cpu/intel.nix +++ b/modules/system/hardware/cpu/intel.nix @@ -9,9 +9,12 @@ in { hardware = { cpu.intel.updateMicrocode = mkDefault config.hardware.enableRedistributableFirmware; - graphics.extraPackages = with pkgs; [ - intel-vaapi-driver - intel-media-driver - ]; + graphics.extraPackages = builtins.attrValues { + inherit + (pkgs) + intel-vaapi-driver + intel-media-driver + ; + }; }; } diff --git a/modules/system/hardware/graphics.nix b/modules/system/hardware/graphics.nix index 94514ea..fd7d492 100644 --- a/modules/system/hardware/graphics.nix +++ b/modules/system/hardware/graphics.nix @@ -11,12 +11,14 @@ in { hardware = { graphics = { enable = true; - extraPackages = with pkgs; - mkIf cfg.amd.enable [ + extraPackages = mkIf cfg.amd.enable (builtins.attrValues { + inherit + (pkgs) mesa libva vaapiVdpa - ]; + ; + }); }; nvidia = mkIf cfg.nvidia.enable { modesetting.enable = true; diff --git a/modules/user/default.nix b/modules/user/default.nix index 0ddc39d..3ee98f7 100644 --- a/modules/user/default.nix +++ b/modules/user/default.nix @@ -11,10 +11,9 @@ module = { config = { environment.sessionVariables.EDITOR = "hx"; - environment.systemPackages = with packages; [ - fish - helix - ]; + environment.systemPackages = builtins.attrValues { + inherit (packages) fish helix; + }; }; }; } diff --git a/modules/user/kakoune/default.nix b/modules/user/kakoune/default.nix index 16d1bed..2664bf2 100644 --- a/modules/user/kakoune/default.nix +++ b/modules/user/kakoune/default.nix @@ -31,11 +31,9 @@ ln -s --relative "$autoload_target" autoload ''; }; - - plugins = with kakounePlugins; [ - fzf-kak - kakoune-catppuccin - ]; + plugins = builtins.attrValues { + inherit (kakounePlugins) fzf-kak kakoune-catppuccin; + }; kakoune-wrapped = symlinkJoin { name = "kakoune-wrapped"; diff --git a/modules/user/shell/packages.nix b/modules/user/shell/packages.nix index c29584a..0460f68 100644 --- a/modules/user/shell/packages.nix +++ b/modules/user/shell/packages.nix @@ -1,71 +1,65 @@ -pkgs: (with pkgs; [ - # better cd - zoxide - #better ls - eza - atuin - - # better cat - bat - - # clipboard - # yazi - serpl - diff-so-fancy - tig - direnv - - sesh - mprocs - curlie - entr - procs - sd - # mult - glow - - # dua-cli - dust - kondo - - # better grep - ripgrep - - # better dig - dogdns - - # simply the best fetch tool out there - microfetch - - fzf - element - carapace - difftastic - hexyl - iputils - gnumake - gping - asciinema - inetutils - scc - starship - onefetch - wget - cpufetch - yt-dlp - tealdeer - glow - hyperfine - imagemagick - ffmpeg-full - # catimg - timg - nmap - wget - fd - jq - rsync - figlet - unzip - zip -]) +pkgs: +builtins.attrValues { + inherit + (pkgs) + # better cd + zoxide + #better ls + eza + atuin + # better cat + bat + # clipboard + # yazi + serpl + diff-so-fancy + tig + direnv + sesh + mprocs + curlie + entr + procs + sd + # mult + glow + # dua-cli + dust + kondo + # better grep + ripgrep + # better dig + dogdns + # simply the best fetch tool out there + microfetch + fzf + element + carapace + difftastic + hexyl + iputils + gnumake + gping + asciinema + inetutils + scc + starship + onefetch + wget + cpufetch + yt-dlp + tealdeer + hyperfine + imagemagick + ffmpeg-full + # catimg + timg + nmap + fd + jq + rsync + figlet + unzip + zip + ; +}