diff options
Diffstat (limited to 'nixos/modules/turris-crossbuild.nix')
-rw-r--r-- | nixos/modules/turris-crossbuild.nix | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/nixos/modules/turris-crossbuild.nix b/nixos/modules/turris-crossbuild.nix new file mode 100644 index 0000000..1f107bd --- /dev/null +++ b/nixos/modules/turris-crossbuild.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, modulesPath, extendModules, ... }: + +with lib; + +let + + crossVariant = host: extendModules { + modules = [{ + nixpkgs.system = host; + nixpkgs.crossSystem = { + inherit (config.nixpkgs.localSystem) system config; + }; + }]; + }; + +in mkIf (config.nixpkgs.crossSystem == null) { + + # TODO for each common platform + system.build.cross.x86_64-linux = crossVariant "x86_64-linux"; + +} |