From 74b3d66baf2f3effb4702832fc45828291a358d8 Mon Sep 17 00:00:00 2001 From: davidak Date: Sat, 5 Sep 2020 02:12:43 +0200 Subject: nixos/config: add defaultPackages option readd perl (used in shell scripts), rsync (needed for NixOps) and strace (common debugging tool) they where previously removed in https://github.com/NixOS/nixpkgs/pull/91213 Co-authored-by: Timo Kaufmann Co-authored-by: 8573 <8573@users.noreply.github.com> --- nixos/doc/manual/release-notes/rl-2009.xml | 6 +++++- nixos/modules/config/system-path.nix | 23 ++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2009.xml b/nixos/doc/manual/release-notes/rl-2009.xml index ce78bda85051..3b5cb470df01 100644 --- a/nixos/doc/manual/release-notes/rl-2009.xml +++ b/nixos/doc/manual/release-notes/rl-2009.xml @@ -1016,7 +1016,11 @@ services.transmission.settings.rpc-bind-address = "0.0.0.0"; Nginx module nginxModules.fastcgi-cache-purge renamed to official name nginxModules.cache-purge. Nginx module nginxModules.ngx_aws_auth renamed to official name nginxModules.aws-auth. - The packages perl, rsync and strace were removed from . If you need them, install them again with = with pkgs; [ perl rsync strace ]; in your configuration.nix. + + + + + The option was added. It installs the packages perl, rsync and strace for now. They were added unconditionally to before, but are not strictly necessary for a minimal NixOS install. You can set it to an empty list to have a more minimal system. Be aware that some functionality might still have an impure dependency on those packages, so things might break. diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index b3c5c6f93f36..67305e8499cb 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -41,6 +41,12 @@ let pkgs.zstd ]; + defaultPackages = map (pkg: setPrio ((pkg.meta.priority or 5) + 3) pkg) + [ pkgs.perl + pkgs.rsync + pkgs.strace + ]; + in { @@ -63,6 +69,21 @@ in ''; }; + defaultPackages = mkOption { + type = types.listOf types.package; + default = defaultPackages; + example = literalExample "[]"; + description = '' + Set of packages users expect from a minimal linux istall. + Like systemPackages, they appear in + /run/current-system/sw. These packages are + automatically available to all users, and are + automatically updated every time you rebuild the system + configuration. + If you want a more minimal system, set it to an empty list. + ''; + }; + pathsToLink = mkOption { type = types.listOf types.str; # Note: We need `/lib' to be among `pathsToLink' for NSS modules @@ -102,7 +123,7 @@ in config = { - environment.systemPackages = requiredPackages; + environment.systemPackages = requiredPackages ++ config.environment.defaultPackages; environment.pathsToLink = [ "/bin" -- cgit 1.4.1