1 # This module defines the packages that appear in
2 # /run/current-system/sw.
12 map (pkg: lib.setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg)
16 pkgs.bashInteractive # bash with ncurses support
37 config.programs.ssh.package
47 defaultPackageNames = [
52 defaultPackages = map (
57 lib.setPrio ((pkg.meta.priority or lib.meta.defaultPriority) + 3) pkg
58 ) defaultPackageNames;
59 defaultPackagesText = "[ ${lib.concatMapStringsSep " " (n: "pkgs.${n}") defaultPackageNames} ]";
68 systemPackages = lib.mkOption {
69 type = lib.types.listOf lib.types.package;
71 example = lib.literalExpression "[ pkgs.firefox pkgs.thunderbird ]";
73 The set of packages that appear in
74 /run/current-system/sw. These packages are
75 automatically available to all users, and are
76 automatically updated every time you rebuild the system
77 configuration. (The latter is the main difference with
78 installing them in the default profile,
79 {file}`/nix/var/nix/profiles/default`.
83 defaultPackages = lib.mkOption {
84 type = lib.types.listOf lib.types.package;
85 default = defaultPackages;
86 defaultText = lib.literalMD ''
87 these packages, with their `meta.priority` numerically increased
88 (thus lowering their installation priority):
90 ${defaultPackagesText}
94 Set of default packages that aren't strictly necessary
95 for a running system, entries can be removed for a more
96 minimal NixOS installation.
98 Like with systemPackages, packages are installed to
99 {file}`/run/current-system/sw`. They are
100 automatically available to all users, and are
101 automatically updated every time you rebuild the system
106 pathsToLink = lib.mkOption {
107 type = lib.types.listOf lib.types.str;
108 # Note: We need `/lib' to be among `pathsToLink' for NSS modules
112 description = "List of directories to be symlinked in {file}`/run/current-system/sw`.";
115 extraOutputsToInstall = lib.mkOption {
116 type = lib.types.listOf lib.types.str;
123 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`.
125 For example, this can be used to install the `dev` and `info` outputs for all packages in the system environment, if they are available.
127 To use specific outputs instead of configuring them globally, select the corresponding attribute on the package derivation, e.g. `libxml2.dev` or `coreutils.info`.
131 extraSetup = lib.mkOption {
132 type = lib.types.lines;
134 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.";
141 path = lib.mkOption {
144 The packages you want in the boot environment.
154 environment.systemPackages = requiredPackages ++ config.environment.defaultPackages;
156 environment.pathsToLink = [
161 "/lib" # FIXME: remove and update debug-info.nix
169 "/share/kservicetypes5"
172 "/share/thumbnailers"
175 system.path = pkgs.buildEnv {
176 name = "system-path";
177 paths = config.environment.systemPackages;
178 inherit (config.environment) pathsToLink extraOutputsToInstall;
179 ignoreCollisions = true;
180 # !!! Hacky, should modularise.
181 # outputs TODO: note that the tools will often not be linked by default
183 # Remove wrapped binaries, they shouldn't be accessible via PATH.
184 find $out/bin -maxdepth 1 -name ".*-wrapped" -type l -delete
186 if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then
187 $out/bin/glib-compile-schemas $out/share/glib-2.0/schemas
190 ${config.environment.extraSetup}