1 # This module defines the packages that appear in
2 # /run/current-system/sw.
3 { config, lib, pkgs, ... }:
6 requiredPackages = map (pkg: lib.setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg)
9 pkgs.bashInteractive # bash with ncurses support
30 config.programs.ssh.package
47 (n: let pkg = pkgs.${n};in lib.setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg)
49 defaultPackagesText = "[ ${lib.concatMapStringsSep " " (n: "pkgs.${n}") defaultPackageNames } ]";
58 systemPackages = lib.mkOption {
59 type = lib.types.listOf lib.types.package;
61 example = lib.literalExpression "[ pkgs.firefox pkgs.thunderbird ]";
63 The set of packages that appear in
64 /run/current-system/sw. These packages are
65 automatically available to all users, and are
66 automatically updated every time you rebuild the system
67 configuration. (The latter is the main difference with
68 installing them in the default profile,
69 {file}`/nix/var/nix/profiles/default`.
73 defaultPackages = lib.mkOption {
74 type = lib.types.listOf lib.types.package;
75 default = defaultPackages;
76 defaultText = lib.literalMD ''
77 these packages, with their `meta.priority` numerically increased
78 (thus lowering their installation priority):
80 ${defaultPackagesText}
84 Set of default packages that aren't strictly necessary
85 for a running system, entries can be removed for a more
86 minimal NixOS installation.
88 Like with systemPackages, packages are installed to
89 {file}`/run/current-system/sw`. They are
90 automatically available to all users, and are
91 automatically updated every time you rebuild the system
96 pathsToLink = lib.mkOption {
97 type = lib.types.listOf lib.types.str;
98 # Note: We need `/lib' to be among `pathsToLink' for NSS modules
102 description = "List of directories to be symlinked in {file}`/run/current-system/sw`.";
105 extraOutputsToInstall = lib.mkOption {
106 type = lib.types.listOf lib.types.str;
108 example = [ "dev" "info" ];
110 Entries listed here will be appended to the `meta.outputsToInstall` attribute for each package in `environment.systemPackages`, and the files from the corresponding derivation outputs symlinked into {file}`/run/current-system/sw`.
112 For example, this can be used to install the `dev` and `info` outputs for all packages in the system environment, if they are available.
114 To use specific outputs instead of configuring them globally, select the corresponding attribute on the package derivation, e.g. `libxml2.dev` or `coreutils.info`.
118 extraSetup = lib.mkOption {
119 type = lib.types.lines;
121 description = "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.";
128 path = lib.mkOption {
131 The packages you want in the boot environment.
141 environment.systemPackages = requiredPackages ++ config.environment.defaultPackages;
143 environment.pathsToLink =
148 "/lib" # FIXME: remove and update debug-info.nix
156 "/share/kservicetypes5"
159 "/share/thumbnailers"
162 system.path = pkgs.buildEnv {
163 name = "system-path";
164 paths = config.environment.systemPackages;
165 inherit (config.environment) pathsToLink extraOutputsToInstall;
166 ignoreCollisions = true;
167 # !!! Hacky, should modularise.
168 # outputs TODO: note that the tools will often not be linked by default
171 # Remove wrapped binaries, they shouldn't be accessible via PATH.
172 find $out/bin -maxdepth 1 -name ".*-wrapped" -type l -delete
174 if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then
175 $out/bin/glib-compile-schemas $out/share/glib-2.0/schemas
178 ${config.environment.extraSetup}