summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorNicolas B. Pierron <nicolas.b.pierron@nbp.name>2016-12-25 18:50:00 +0000
committerNicolas B. Pierron <nicolas.b.pierron@gmail.com>2017-01-16 01:17:33 +0100
commit83f7d5fc0a630ab1c845b13a8cacf7a693469438 (patch)
tree3d30b84bece477ccebcdc40a71f7fac7e506fb2d /nixos
parentf5dfe78a1eb5ff8dfcc7ab37cfc132c5f31d3cef (diff)
downloadnixlib-83f7d5fc0a630ab1c845b13a8cacf7a693469438.tar
nixlib-83f7d5fc0a630ab1c845b13a8cacf7a693469438.tar.gz
nixlib-83f7d5fc0a630ab1c845b13a8cacf7a693469438.tar.bz2
nixlib-83f7d5fc0a630ab1c845b13a8cacf7a693469438.tar.lz
nixlib-83f7d5fc0a630ab1c845b13a8cacf7a693469438.tar.xz
nixlib-83f7d5fc0a630ab1c845b13a8cacf7a693469438.tar.zst
nixlib-83f7d5fc0a630ab1c845b13a8cacf7a693469438.zip
Add NixOS option 'nixpkgs.overlays' to set the argument of Nixpkgs.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/misc/nixpkgs.nix48
1 files changed, 35 insertions, 13 deletions
diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix
index 7d50b8025bdd..885d56216ed5 100644
--- a/nixos/modules/misc/nixpkgs.nix
+++ b/nixos/modules/misc/nixpkgs.nix
@@ -29,11 +29,19 @@ let
     };
 
   configType = mkOptionType {
-    name = "nixpkgs config";
+    name = "nixpkgs-config";
+    description = "nixpkgs config"
     check = traceValIfNot isConfig;
     merge = args: fold (def: mergeConfig def.value) {};
   };
 
+  overlayType = mkOptionType {
+    name = "nixpkgs-overlay";
+    description = "nixpkgs overlay";
+    check = builtins.isFunction;
+    merge = lib.mergeOneOption;
+  };
+
 in
 
 {
@@ -43,23 +51,37 @@ in
       default = {};
       example = literalExample
         ''
-          { firefox.enableGeckoMediaPlayer = true;
-            packageOverrides = pkgs: {
-              firefox60Pkgs = pkgs.firefox60Pkgs.override {
-                enableOfficialBranding = true;
-              };
-            };
-          }
+          { firefox.enableGeckoMediaPlayer = true; }
         '';
       type = configType;
       description = ''
         The configuration of the Nix Packages collection.  (For
         details, see the Nixpkgs documentation.)  It allows you to set
-        package configuration options, and to override packages
-        globally through the <varname>packageOverrides</varname>
-        option.  The latter is a function that takes as an argument
-        the <emphasis>original</emphasis> Nixpkgs, and must evaluate
-        to a set of new or overridden packages.
+        package configuration options.
+      '';
+    };
+
+    nixpkgs.overlays = mkOption {
+      default = [];
+      example = literalExample
+        ''
+          [ (self: super: {
+              openssh = super.openssh.override {
+                hpnSupport = true;
+                withKerberos = true;
+                kerberos = self.libkrb5
+              };
+            };
+          ) ]
+        '';
+      type = lib.listOf overlayType;
+      description = ''
+        List of overlays to use with the Nix Packages collection.
+        (For details, see the Nixpkgs documentation.)  It allows
+        you to override packages globally. This is a function that
+        takes as an argument the <emphasis>original</emphasis> Nixpkgs.
+        The first argument should be used for finding dependencies, and
+        the second should be used for overriding recipes.
       '';
     };