From 34487947ce665d14c340719d844de0be08d7c85f Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 1 Mar 2018 14:58:15 -0500 Subject: [PATCH] nixos: Add nixpkgs.crossSystem option for cross-compilation --- nixos/modules/misc/nixpkgs.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index 11bd148d5dee..9217250eec29 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 {}''; 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 nixpkgs.pkgs is set. + ''; + }; + system = mkOption { type = types.str; example = "i686-linux";