aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/turris-crossbuild.nix
blob: b1c7dc6b06af0d5bbfc0550df615677b384495db (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 = mkForce 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
  );

}