aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/turris-crossbuild.nix
blob: d070d6cc3c2b4112ca24a75435b2ab3bc4d5a66d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ 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) {

  system.build.cross = genAttrs lib.systems.flakeExposed (system:
    crossVariant system
  );

}