1# This module defines the packages that appear in 2# /run/current-system/sw. 3 4{ config, lib, pkgs, ... }: 5 6with lib; 7 8let 9 10 requiredPackages = 11 [ config.nix.package 12 pkgs.acl 13 pkgs.attr 14 pkgs.bashInteractive # bash with ncurses support 15 pkgs.bzip2 16 pkgs.coreutils 17 pkgs.cpio 18 pkgs.curl 19 pkgs.diffutils 20 pkgs.findutils 21 pkgs.gawk 22 pkgs.glibc # for ldd, getent 23 pkgs.gnugrep 24 pkgs.gnupatch 25 pkgs.gnused 26 pkgs.gnutar 27 pkgs.gzip 28 pkgs.xz 29 pkgs.less 30 pkgs.libcap 31 pkgs.nano 32 pkgs.ncurses 33 pkgs.netcat 34 config.programs.ssh.package 35 pkgs.perl 36 pkgs.procps 37 pkgs.rsync 38 pkgs.strace 39 pkgs.su 40 pkgs.time 41 pkgs.texinfoInteractive 42 pkgs.utillinux 43 ]; 44 45in 46 47{ 48 options = { 49 50 environment = { 51 52 systemPackages = mkOption { 53 type = types.listOf types.package; 54 default = []; 55 example = literalExample "[ pkgs.firefox pkgs.thunderbird ]"; 56 description = '' 57 The set of packages that appear in 58 /run/current-system/sw. These packages are 59 automatically available to all users, and are 60 automatically updated every time you rebuild the system 61 configuration. (The latter is the main difference with 62 installing them in the default profile, 63 <filename>/nix/var/nix/profiles/default</filename>. 64 ''; 65 }; 66 67 pathsToLink = mkOption { 68 type = types.listOf types.str; 69 # Note: We need `/lib' to be among `pathsToLink' for NSS modules 70 # to work. 71 default = []; 72 example = ["/"]; 73 description = "List of directories to be symlinked in <filename>/run/current-system/sw</filename>."; 74 }; 75 76 outputsToLink = mkOption { 77 type = types.listOf types.str; 78 default = []; 79 example = [ "doc" ]; 80 description = "List of package outputs to be symlinked into <filename>/run/current-system/sw</filename>."; 81 }; 82 83 }; 84 85 system = { 86 87 path = mkOption { 88 internal = true; 89 description = '' 90 The packages you want in the boot environment. 91 ''; 92 }; 93 94 }; 95 96 }; 97 98 config = { 99 100 environment.systemPackages = requiredPackages; 101 102 environment.pathsToLink = 103 [ "/bin" 104 "/etc/xdg" 105 "/info" 106 "/lib" # FIXME: remove and update debug-info.nix 107 "/sbin" 108 "/share/applications" 109 "/share/desktop-directories" 110 "/share/doc" 111 "/share/emacs" 112 "/share/icons" 113 "/share/info" 114 "/share/menus" 115 "/share/mime" 116 "/share/nano" 117 "/share/org" 118 "/share/terminfo" 119 "/share/themes" 120 "/share/vim-plugins" 121 ]; 122 123 system.path = pkgs.buildEnv { 124 name = "system-path"; 125 paths = config.environment.systemPackages; 126 inherit (config.environment) pathsToLink outputsToLink; 127 ignoreCollisions = true; 128 # !!! Hacky, should modularise. 129 postBuild = 130 '' 131 if [ -x $out/bin/update-mime-database -a -w $out/share/mime ]; then 132 XDG_DATA_DIRS=$out/share $out/bin/update-mime-database -V $out/share/mime > /dev/null 133 fi 134 135 if [ -x $out/bin/gtk-update-icon-cache -a -f $out/share/icons/hicolor/index.theme ]; then 136 $out/bin/gtk-update-icon-cache $out/share/icons/hicolor 137 fi 138 139 if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then 140 $out/bin/glib-compile-schemas $out/share/glib-2.0/schemas 141 fi 142 143 if [ -x $out/bin/update-desktop-database -a -w $out/share/applications ]; then 144 $out/bin/update-desktop-database $out/share/applications 145 fi 146 147 if [ -x $out/bin/install-info -a -w $out/share/info ]; then 148 shopt -s nullglob 149 for i in $out/share/info/*.info $out/share/info/*.info.gz; do 150 $out/bin/install-info $i $out/share/info/dir 151 done 152 fi 153 ''; 154 }; 155 156 }; 157}