From 7323e619c9aeda02dd9369e46d605023bd577db7 Mon Sep 17 00:00:00 2001 From: Dave Gallant Date: Tue, 5 Jul 2022 01:42:15 +0000 Subject: [PATCH] Refactor packages --- common/packages.nix | 215 ------------------ flake.lock | 30 +-- flake.nix | 13 +- .../nixos-wsl/modules/wsl-distro.nix | 2 +- packages/common.nix | 160 +++++++++++++ packages/desktop.nix | 49 ++++ packages/linux.nix | 26 +++ 7 files changed, 258 insertions(+), 237 deletions(-) delete mode 100644 common/packages.nix create mode 100644 packages/common.nix create mode 100644 packages/desktop.nix create mode 100644 packages/linux.nix diff --git a/common/packages.nix b/common/packages.nix deleted file mode 100644 index 0490645..0000000 --- a/common/packages.nix +++ /dev/null @@ -1,215 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - inherit (pkgs) stdenv; -in { - # System-wide packages to install. - environment.systemPackages = with pkgs; let - common = - [ - # essentials - curl - gcc - git - git-crypt - gnupg - imagemagick - jq - ripgrep - unzip - xclip - xdg_utils - yq-go - zip - - # ansible - /* - ansible - */ - /* - ansible-lint - */ - - # productivity - bat - /* - checkov - */ - colordiff - drone-cli - exa - fd - github-cli - gnumake - go-jira - hadolint - nodePackages.eslint - oha - postman - pre-commit - shellcheck - shfmt - starship - tldr - tmux-sessionizer - - # containers - docker - docker-compose - kubectl - kubernetes-helm - kustomize - minikube - stern - - # language servers - nodePackages.bash-language-server - nodePackages.pyright - nodePackages.yaml-language-server - sumneko-lua-language-server - - # monitoring - ctop - /* - glances - */ - htop - procs - - # data tools - dbeaver - - # lua - lua53Packages.luacheck - stylua - - # golang - golangci-lint - gopls - gofumpt - - # js - nodejs - nodePackages.prettier - nodePackages.yarn - - # video - youtube-dl - - # networking - arp-scan - /* - dnsutils - */ - iperf - nmap - openssl - openvpn - sshfs # mac requires https://osxfuse.github.io/ - vpngate - whois - - # backup - rclone - restic - - # infra - terraform-ls - terraformer - tflint - tfswitch - infracost - - # nix - alejandra - cachix - nix-diff - nixfmt - nixpkgs-fmt - nixpkgs-review - rnix-lsp - - # cloud - /* - awscli2 - */ - /* - ssm-session-manager-plugin - */ - google-cloud-sdk - - # python - python310 - /* - python310Packages.black - */ - python310Packages.ipython - python310Packages.pip - /* - python310Packages.poetry - */ - python310Packages.setuptools - python310Packages.virtualenv - - # blog - hugo - - # news - srv - ] - ++ lib.optionals stdenv.isLinux [ - albert - authy - bitwarden - brave - calibre - cryptsetup - deluge - discord - firefox - ghostscript - gimp-with-plugins - glibcLocales - gnome3.gnome-tweaks - gnomeExtensions.appindicator - google-chrome - guake - i3lock-fancy-rapid - iotop - kazam - keyleds - linuxPackages.perf - minecraft - mojave-gtk-theme - netdata - nvfancontrol - pavucontrol - pinentry-curses - podman - qemu - rfd - rtorrent - rustup - signal-desktop - slack - spotify - steam - strace - tailscale - usbutils - virtmanager - vlc - vscodium - wireshark-qt - xautolock - yaru-theme - zoom-us - ]; - in - common; - - programs.gnupg.agent.enable = true; -} diff --git a/flake.lock b/flake.lock index 4065b4a..1ed5df8 100644 --- a/flake.lock +++ b/flake.lock @@ -59,11 +59,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1656367977, - "narHash": "sha256-0hV17V9Up9pnAtPJ+787FhrsPnawxoTPA/VxgjRMrjc=", + "lastModified": 1656927578, + "narHash": "sha256-ZSFrM/1PlJOqCb3mN88ZUh9dkQvNLU/nkoQ2tu02/FM=", "owner": "nix-community", "repo": "home-manager", - "rev": "3bf16c0fd141c28312be52945d1543f9ce557bb1", + "rev": "f2445620d177e295e711c1b2bc6c01ed6df26c16", "type": "github" }, "original": { @@ -82,11 +82,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1656735907, - "narHash": "sha256-6tDUHALUyszphRnZFCD7c78eESphfRX2L6FnWCVVNIc=", + "lastModified": 1656904399, + "narHash": "sha256-lJRk5fLa5xPARKIhslP9J6dLuhjV+4HmCfa+tr2HqvA=", "owner": "neovim", "repo": "neovim", - "rev": "a9de89894a2ff43dd511b38f20ab2815d6c7e2bd", + "rev": "f075feee3258d15f6549e33c185f6165f9c7fbfc", "type": "github" }, "original": { @@ -103,11 +103,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1656749719, - "narHash": "sha256-r/3k68MkeV1T6lSp2R9ewT+Bj1a6N3ZjUXE4y7fjJLk=", + "lastModified": 1656922590, + "narHash": "sha256-m8SRuH6NgQ8AB7W+Oev/ip7O56YzGHHV7DMjw+bT+aM=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "25b1177974a2d13c5bf3109f17940ce07c1cd043", + "rev": "61ce522387dc8219b1efe4315fb65ddbadae2b60", "type": "github" }, "original": { @@ -118,11 +118,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1656702262, - "narHash": "sha256-BdVdx6LoGgAeIYrHnzk+AgbtkaVlV3JNcC6+vltLuh0=", + "lastModified": 1656933710, + "narHash": "sha256-SVG8EqY1OTJWBRY4hpct2ZR2Rk0L8hCFkug3m0ABoZE=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "c5308381432cdbf14d5b1128747a2845f5c6871e", + "rev": "3bf48d3587d3f34f745a19ebc968b002ef5b5c5a", "type": "github" }, "original": { @@ -134,11 +134,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1656461576, - "narHash": "sha256-rlmmw6lIlkMQIiB+NsnO8wQYWTfle8TA41UREPLP5VY=", + "lastModified": 1656753965, + "narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=", "owner": "nixos", "repo": "nixpkgs", - "rev": "cf3ab54b4afe2b7477faa1dd0b65bf74c055d70c", + "rev": "0ea7a8f1b939d74e5df8af9a8f7342097cdf69eb", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 345c54a..c2a5c23 100644 --- a/flake.nix +++ b/flake.nix @@ -31,7 +31,7 @@ defaultModules = [ home-manager.nixosModules.home-manager ./common/fonts.nix - ./common/packages.nix + ./packages/common.nix ({ config, @@ -71,12 +71,13 @@ }) ]; desktopLinuxModules = [ - ./common/printing.nix - ./services/netdata/default.nix - ./services/keyleds/default.nix + ./common/desktop.nix ./common/linux.nix ./common/networking.nix - ./common/desktop.nix + ./common/printing.nix + ./packages/desktop.nix + ./services/keyleds/default.nix + ./services/netdata/default.nix ]; in { hephaestus = nixpkgs.lib.nixosSystem { @@ -106,7 +107,7 @@ modules = [ home-manager.darwinModules.home-manager ./common/darwin.nix - ./common/packages.nix + ./packages/common.nix ./machines/zelus/configuration.nix diff --git a/machines/gallantis/nixos-wsl/modules/wsl-distro.nix b/machines/gallantis/nixos-wsl/modules/wsl-distro.nix index fbca467..463459a 100644 --- a/machines/gallantis/nixos-wsl/modules/wsl-distro.nix +++ b/machines/gallantis/nixos-wsl/modules/wsl-distro.nix @@ -22,7 +22,7 @@ with lib; { }; defaultUser = mkOption { type = str; - default = "dave"; + default = "nixos"; description = "The name of the default user"; }; startMenuLaunchers = mkEnableOption "shortcuts for GUI applications in the windows start menu"; diff --git a/packages/common.nix b/packages/common.nix new file mode 100644 index 0000000..8260b37 --- /dev/null +++ b/packages/common.nix @@ -0,0 +1,160 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (pkgs) stdenv; +in { + # System-wide packages to install. + environment.systemPackages = with pkgs; let + common = [ + # essentials + curl + gcc + git + git-crypt + gnupg + imagemagick + jq + ripgrep + unzip + xclip + xdg_utils + yq-go + zip + + # ansible + /* + ansible + */ + /* + ansible-lint + */ + + # productivity + bat + /* + checkov + */ + colordiff + drone-cli + exa + fd + github-cli + gnumake + go-jira + hadolint + nodePackages.eslint + oha + postman + pre-commit + shellcheck + shfmt + starship + tldr + tmux-sessionizer + + # containers + docker + docker-compose + kubectl + kubernetes-helm + kustomize + minikube + stern + + # language servers + nodePackages.bash-language-server + nodePackages.pyright + nodePackages.yaml-language-server + sumneko-lua-language-server + + # monitoring + ctop + /* + glances + */ + htop + procs + + # lua + lua53Packages.luacheck + stylua + + # golang + golangci-lint + gopls + gofumpt + + # js + nodejs + nodePackages.prettier + nodePackages.yarn + + # video + youtube-dl + + # networking + arp-scan + /* + dnsutils + */ + iperf + nmap + openssl + openvpn + sshfs # mac requires https://osxfuse.github.io/ + vpngate + whois + + # backup + rclone + restic + + # infra + terraform-ls + terraformer + tflint + tfswitch + infracost + + # nix + alejandra + cachix + nix-diff + nixfmt + nixpkgs-fmt + nixpkgs-review + rnix-lsp + + # cloud + /* + awscli2 + */ + /* + ssm-session-manager-plugin + */ + google-cloud-sdk + + # python + python310 + python310Packages.black + python310Packages.ipython + python310Packages.pip + python310Packages.poetry + python310Packages.setuptools + python310Packages.virtualenv + + # blog + hugo + + # news + rfd + srv + ]; + in + common; + + programs.gnupg.agent.enable = true; +} diff --git a/packages/desktop.nix b/packages/desktop.nix new file mode 100644 index 0000000..6fa4b05 --- /dev/null +++ b/packages/desktop.nix @@ -0,0 +1,49 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (pkgs) stdenv; +in { + # System-wide packages to install. + environment.systemPackages = with pkgs; let + linuxDesktop = [ + albert + authy + bitwarden + brave + calibre + deluge + discord + firefox + ghostscript + gimp-with-plugins + gnome3.gnome-tweaks + gnomeExtensions.appindicator + guake + i3lock-fancy-rapid + kazam + keyleds + nvfancontrol + pavucontrol + podman + qemu + signal-desktop + slack + spotify + steam + usbutils + virtmanager + vlc + vscodium + wireshark-qt + xautolock + yaru-theme + zoom-us + ]; + in + linuxDesktop; + + programs.gnupg.agent.enable = true; +} diff --git a/packages/linux.nix b/packages/linux.nix new file mode 100644 index 0000000..d2bb4cd --- /dev/null +++ b/packages/linux.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (pkgs) stdenv; +in { + # System-wide packages to install. + environment.systemPackages = with pkgs; let + linux = [ + cryptsetup + glibcLocales + iotop + linuxPackages.perf + netdata + pinentry-curses + rustup + strace + tailscale + ]; + in + linux; + + programs.gnupg.agent.enable = true; +}