depot/ops/nixos/default.nix
2020-11-01 14:25:17 +00:00

23 lines
846 B
Nix

# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ depot, lib, pkgs, ... }@args:
let
inherit (builtins) foldl' mapAttrs;
baseModule = name: { ... }: {
_module.args = args // {
rebuilder = rebuilder name;
};
};
systemFor = systemName: config:
(depot.third_party.nixeval {
system = builtins.currentSystem;
modules = [ (baseModule systemName) (args: { imports = [ lib/common.nix config ]; }) ];
}).config.system.build.toplevel;
systems = [ "porcorosso" "ixvm-fra01" "marukuru" "clouvider-fra01" "totoro" "kusakabe" "swann" ];
rebuilder = system: (import ./lib/rebuilder.nix (args // { system = system; }));
systemCfgs = lib.genAttrs systems
(name: import (./. + "/${name}"));
systemDrvs = mapAttrs systemFor systemCfgs;
in systemDrvs