summary refs log tree commit diff
path: root/nixos/modules/misc/nixpkgs.nix
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2018-03-01 14:58:15 -0500
committerShea Levy <shea@shealevy.com>2018-03-01 14:58:15 -0500
commit34487947ce665d14c340719d844de0be08d7c85f (patch)
treec2c44558d4f0f92ff643c20758662ed021396751 /nixos/modules/misc/nixpkgs.nix
parent95579af5ec0a282d8ab2fccfeeff445c2c63c74f (diff)
downloadnixpkgs-34487947ce665d14c340719d844de0be08d7c85f.tar
nixpkgs-34487947ce665d14c340719d844de0be08d7c85f.tar.gz
nixpkgs-34487947ce665d14c340719d844de0be08d7c85f.tar.bz2
nixpkgs-34487947ce665d14c340719d844de0be08d7c85f.tar.lz
nixpkgs-34487947ce665d14c340719d844de0be08d7c85f.tar.xz
nixpkgs-34487947ce665d14c340719d844de0be08d7c85f.tar.zst
nixpkgs-34487947ce665d14c340719d844de0be08d7c85f.zip
nixos: Add nixpkgs.crossSystem option for cross-compilation
Diffstat (limited to 'nixos/modules/misc/nixpkgs.nix')
-rw-r--r--nixos/modules/misc/nixpkgs.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix
index 11bd148d5de..9217250eec2 100644
--- a/nixos/modules/misc/nixpkgs.nix
+++ b/nixos/modules/misc/nixpkgs.nix
@@ -61,7 +61,7 @@ in
             inherit (config.nixpkgs) config overlays system;
           }
         '';
-      default = import ../../.. { inherit (cfg) config overlays system; };
+      default = import ../../.. { inherit (cfg) config overlays system crossSystem; };
       type = pkgsType;
       example = literalExample ''import <nixpkgs> {}'';
       description = ''
@@ -130,6 +130,18 @@ in
       '';
     };
 
+    crossSystem = mkOption {
+      type = types.nullOr types.attrs;
+      default = null;
+      description = ''
+        The description of the system we're cross-compiling to, or null
+        if this isn't a cross-compile. See the description of the
+        crossSystem argument in the nixpkgs manual.
+
+        Ignored when <code>nixpkgs.pkgs</code> is set.
+      '';
+    };
+
     system = mkOption {
       type = types.str;
       example = "i686-linux";