From 604cc01ad92d58184c6fa976c44ead299943ec65 Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Sun, 26 Apr 2020 11:55:40 -0400 Subject: [PATCH] nixos/lib: factor out common system packages --- nixos/lib/system.nix | 29 ++++++++++++++++++++++++++++- nixos/routnerr-2/configuration.nix | 27 ++------------------------- nixos/servnerr-3/configuration.nix | 18 +++--------------- 3 files changed, 33 insertions(+), 41 deletions(-) diff --git a/nixos/lib/system.nix b/nixos/lib/system.nix index 5a65e43..fcb1aae 100644 --- a/nixos/lib/system.nix +++ b/nixos/lib/system.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, pkgs, ... }: { # Console configuration. @@ -18,6 +18,33 @@ # Assume all NixOS machines are headless. # TODO: factor out if I ever switch my desktop. noXlibs = true; + + # Packages which should be installed on every machine. + systemPackages = with pkgs; [ + byobu + dmidecode + ethtool + gcc + go + git + htop + iftop + iperf3 + jq + lm_sensors + lshw + ndisc6 + neofetch + nethogs + nixfmt + nmap + pciutils + tcpdump + tmux + usbutils + wget + wireguard-tools + ]; }; system = { diff --git a/nixos/routnerr-2/configuration.nix b/nixos/routnerr-2/configuration.nix index e9c677d..331aebc 100644 --- a/nixos/routnerr-2/configuration.nix +++ b/nixos/routnerr-2/configuration.nix @@ -61,36 +61,13 @@ in { }; }; - # List packages installed in system profile. To search, run: - # $ nix search wget + # Packages specific to this machine. The base package set is defined in + # lib/system.nix. environment.systemPackages = with pkgs; [ # Stable packages. bind - byobu cbfstool - dmidecode - ethtool flashrom - gcc - go - git - htop - iftop - iperf3 - jq - lm_sensors - lshw - ndisc6 - neofetch - nethogs - nixfmt - nmap - pciutils - tcpdump - tmux - usbutils - wget - wireguard-tools # Unstable packages. unstable.corerad diff --git a/nixos/servnerr-3/configuration.nix b/nixos/servnerr-3/configuration.nix index 7d5f748..b7f7906 100644 --- a/nixos/servnerr-3/configuration.nix +++ b/nixos/servnerr-3/configuration.nix @@ -48,21 +48,9 @@ # Allow the use of Plex. nixpkgs.config.allowUnfree = true; - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - byobu - git - htop - jq - lm_sensors - lshw - nixfmt - screenfetch - tmux - wget - zfs - ]; + # Packages specific to this machine. The base package set is defined in + # lib/system.nix. + environment.systemPackages = with pkgs; [ zfs ]; nix = { # Automatic Nix GC.