depot/ops/nixos/default.nix

24 lines
827 B
Nix
Raw Normal View History

# 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;
2020-06-28 18:32:52 +00:00
systems = [ "porcorosso" "ixvm-fra01" "marukuru" "clouvider-fra01" "totoro" ];
rebuilder = system: (import ./lib/rebuilder.nix (args // { system = system; }));
systemCfgs = lib.genAttrs systems
(name: import (./. + "/${name}"));
systemDrvs = mapAttrs systemFor systemCfgs;
2020-06-28 18:32:52 +00:00
in systemDrvs