summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-01-28 11:24:18 +0100
committerVladimír Čunát <vcunat@gmail.com>2016-01-28 11:24:18 +0100
commitab8a691d059b364c435a1871ae2ef70a578685d8 (patch)
treea9158496e379970c0cb25b4068488c46fccc3f16 /nixos/modules/config
parenta33fcc873110a6ded62f3286d9850ac5a445df89 (diff)
downloadnixlib-ab8a691d059b364c435a1871ae2ef70a578685d8.tar
nixlib-ab8a691d059b364c435a1871ae2ef70a578685d8.tar.gz
nixlib-ab8a691d059b364c435a1871ae2ef70a578685d8.tar.bz2
nixlib-ab8a691d059b364c435a1871ae2ef70a578685d8.tar.lz
nixlib-ab8a691d059b364c435a1871ae2ef70a578685d8.tar.xz
nixlib-ab8a691d059b364c435a1871ae2ef70a578685d8.tar.zst
nixlib-ab8a691d059b364c435a1871ae2ef70a578685d8.zip
nixos systemPackages: rework default outputs
- Now `pkg.outputUnspecified = true` but this attribute is missing in
  every output, so we can recognize whether the user chose or not.
  If (s)he didn't choose, we put `pkg.bin or pkg.out or pkg` into
  `systemPackages`.
- `outputsToLink` is replaced by `extraOutputsToLink`.
  We add extra outputs *regardless* of whether the user chose anything.
  It's mainly meant for outputs with docs and debug symbols.
- Note that as a result, some libraries will disappear from system path.
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/debug-info.nix2
-rw-r--r--nixos/modules/config/system-path.nix19
2 files changed, 10 insertions, 11 deletions
diff --git a/nixos/modules/config/debug-info.nix b/nixos/modules/config/debug-info.nix
index a096a9809cee..777ae71eebfb 100644
--- a/nixos/modules/config/debug-info.nix
+++ b/nixos/modules/config/debug-info.nix
@@ -38,7 +38,7 @@ with lib;
     # environment.pathsToLink, and we can't have both.
     #environment.pathsToLink = [ "/lib/debug/.build-id" ];
 
-    environment.outputsToLink =
+    environment.extraOutputsToLink =
       optional config.environment.enableDebugInfo "debug";
 
   };
diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix
index 3df7d7cdac4f..eb5eba7a042f 100644
--- a/nixos/modules/config/system-path.nix
+++ b/nixos/modules/config/system-path.nix
@@ -73,11 +73,11 @@ in
         description = "List of directories to be symlinked in <filename>/run/current-system/sw</filename>.";
       };
 
-      outputsToLink = mkOption {
+      extraOutputsToLink = mkOption {
         type = types.listOf types.str;
         default = [ ];
-        example = [ "doc" ];
-        description = "List of package outputs to be symlinked into <filename>/run/current-system/sw</filename>.";
+        example = [ "doc" "info" "docdev" ];
+        description = "List of additional package outputs to be symlinked into <filename>/run/current-system/sw</filename>.";
       };
 
     };
@@ -120,18 +120,17 @@ in
         "/share/vim-plugins"
       ];
 
-    environment.outputsToLink = [ "bin" "lib" "out" ];
-
     system.path = pkgs.buildEnv {
       name = "system-path";
       paths =
-        lib.filter (drv: drv != null && drv != (drv.dev or null))
-          (lib.concatMap (drv:
-            [ drv ] ++ map (outputName: drv.${outputName}.outPath or null) config.environment.outputsToLink)
-           config.environment.systemPackages);
-      inherit (config.environment) pathsToLink;
+        # The default output probably shouldn't be globally configurable.
+        # Services and users should specify them explicitly unless they want this default.
+        map (p: if p.outputUnspecified or false then p.bin or p.out or p else p)
+          config.environment.systemPackages;
+      inherit (config.environment) pathsToLink extraOutputsToLink;
       ignoreCollisions = true;
       # !!! Hacky, should modularise.
+      # outputs TODO: note that the tools will often not be linked by default
       postBuild =
         ''
           if [ -x $out/bin/update-mime-database -a -w $out/share/mime ]; then