2021-07-26 01:29:05 +02:00
|
|
|
let
|
2021-07-28 23:55:34 +02:00
|
|
|
krops = builtins.fetchGit { url = "https://cgit.krebsco.de/krops/"; };
|
2021-07-26 01:29:05 +02:00
|
|
|
lib = import "${krops}/lib";
|
2021-07-28 23:55:34 +02:00
|
|
|
pkgs = import "${krops}/pkgs" { };
|
|
|
|
source = machine:
|
|
|
|
lib.evalSource [{
|
2021-07-26 01:29:05 +02:00
|
|
|
config.file = toString ./machines;
|
|
|
|
nixos-config.symlink = "config/${machine}/configuration.nix";
|
|
|
|
nixpkgs.git = {
|
|
|
|
clean.exclude = [ "/.version-suffix" ];
|
|
|
|
ref = "973910f5c31b9ba6c171c33a8bd7199990b14c72"; # nixos-21.05
|
2021-07-28 23:55:34 +02:00
|
|
|
url = "https://github.com/NixOS/nixpkgs";
|
2021-07-26 01:29:05 +02:00
|
|
|
};
|
2021-07-28 23:55:34 +02:00
|
|
|
}];
|
|
|
|
mkTestConfig = hostname: {
|
|
|
|
name = "test-${hostname}";
|
|
|
|
value = pkgs.krops.writeTest "test-${hostname}" {
|
|
|
|
source = source hostname;
|
2021-07-26 03:56:37 +02:00
|
|
|
target = lib.mkTarget {
|
|
|
|
host = "localhost";
|
|
|
|
path = "/tmp/src";
|
|
|
|
};
|
2021-07-26 03:55:56 +02:00
|
|
|
force = true; # force create the sentinel file.
|
2021-07-26 03:14:23 +02:00
|
|
|
};
|
2021-07-28 23:55:34 +02:00
|
|
|
};
|
|
|
|
mkTestsConfig = hostnames: builtins.listToAttrs (map mkTestConfig hostnames);
|
|
|
|
in {
|
|
|
|
core-services-01 = pkgs.krops.writeDeploy "deploy-core-services-01" {
|
|
|
|
source = source "core-services-01";
|
|
|
|
target = "root@core01.internal.rz.ens.wtf";
|
|
|
|
};
|
|
|
|
} // mkTestsConfig [ "core-services-01" "remote-builder-01" ]
|