1 # This module defines the packages that appear in
2 # /run/current-system/sw.
4 { config, lib, pkgs, ... }:
10 requiredPackages = map (pkg: setPrio ((pkg.meta.priority or 5) + 3) pkg)
13 pkgs.bashInteractive # bash with ncurses support
34 config.programs.ssh.package
52 (n: let pkg = pkgs.${n}; in setPrio ((pkg.meta.priority or 5) + 3) pkg)
54 defaultPackagesText = "[ ${concatMapStringsSep " " (n: "pkgs.${n}") defaultPackageNames } ]";
63 systemPackages = mkOption {
64 type = types.listOf types.package;
66 example = literalExpression "[ pkgs.firefox pkgs.thunderbird ]";
67 description = lib.mdDoc ''
68 The set of packages that appear in
69 /run/current-system/sw. These packages are
70 automatically available to all users, and are
71 automatically updated every time you rebuild the system
72 configuration. (The latter is the main difference with
73 installing them in the default profile,
74 {file}`/nix/var/nix/profiles/default`.
78 defaultPackages = mkOption {
79 type = types.listOf types.package;
80 default = defaultPackages;
81 defaultText = literalMD ''
82 these packages, with their `meta.priority` numerically increased
83 (thus lowering their installation priority):
85 ${defaultPackagesText}
88 description = lib.mdDoc ''
89 Set of default packages that aren't strictly necessary
90 for a running system, entries can be removed for a more
91 minimal NixOS installation.
93 Note: If `pkgs.nano` is removed from this list,
94 make sure another editor is installed and the
95 `EDITOR` environment variable is set to it.
96 Environment variables can be set using
97 {option}`environment.variables`.
99 Like with systemPackages, packages are installed to
100 {file}`/run/current-system/sw`. They are
101 automatically available to all users, and are
102 automatically updated every time you rebuild the system
107 pathsToLink = mkOption {
108 type = types.listOf types.str;
109 # Note: We need `/lib' to be among `pathsToLink' for NSS modules
113 description = lib.mdDoc "List of directories to be symlinked in {file}`/run/current-system/sw`.";
116 extraOutputsToInstall = mkOption {
117 type = types.listOf types.str;
119 example = [ "doc" "info" "devdoc" ];
120 description = lib.mdDoc "List of additional package outputs to be symlinked into {file}`/run/current-system/sw`.";
123 extraSetup = mkOption {
126 description = lib.mdDoc "Shell fragments to be run after the system environment has been created. This should only be used for things that need to modify the internals of the environment, e.g. generating MIME caches. The environment being built can be accessed at $out.";
135 description = lib.mdDoc ''
136 The packages you want in the boot environment.
146 environment.systemPackages = requiredPackages ++ config.environment.defaultPackages;
148 environment.pathsToLink =
153 "/lib" # FIXME: remove and update debug-info.nix
163 "/share/kservicetypes5"
166 "/share/thumbnailers"
169 system.path = pkgs.buildEnv {
170 name = "system-path";
171 paths = config.environment.systemPackages;
172 inherit (config.environment) pathsToLink extraOutputsToInstall;
173 ignoreCollisions = true;
174 # !!! Hacky, should modularise.
175 # outputs TODO: note that the tools will often not be linked by default
178 # Remove wrapped binaries, they shouldn't be accessible via PATH.
179 find $out/bin -maxdepth 1 -name ".*-wrapped" -type l -delete
181 if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then
182 $out/bin/glib-compile-schemas $out/share/glib-2.0/schemas
185 ${config.environment.extraSetup}