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/modules/config/system-path.nix | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'nixos/modules') 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