From 0eaf46a1dc961216016a886818ac2a66c14c74e6 Mon Sep 17 00:00:00 2001 From: pennae Date: Sun, 5 Dec 2021 22:51:41 +0100 Subject: nixos/system-path: add defaultText for defaultPackages --- nixos/modules/config/system-path.nix | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'nixos/modules/config/system-path.nix') diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index 6ff4ec2921c..875c4c9c441 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -41,12 +41,17 @@ let pkgs.zstd ]; - defaultPackages = map (pkg: setPrio ((pkg.meta.priority or 5) + 3) pkg) - [ pkgs.nano - pkgs.perl - pkgs.rsync - pkgs.strace - ]; + defaultPackageNames = + [ "nano" + "perl" + "rsync" + "strace" + ]; + defaultPackages = + map + (n: let pkg = pkgs.${n}; in setPrio ((pkg.meta.priority or 5) + 3) pkg) + defaultPackageNames; + defaultPackagesText = "[ ${concatMapStringsSep " " (n: "pkgs.${n}") defaultPackageNames } ]"; in @@ -73,6 +78,11 @@ in defaultPackages = mkOption { type = types.listOf types.package; default = defaultPackages; + defaultText = literalDocBook '' + these packages, with their meta.priority numerically increased + (thus lowering their installation priority): + ${defaultPackagesText} + ''; example = []; description = '' Set of default packages that aren't strictly necessary -- cgit 1.4.1