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" ];
|
2022-06-26 23:48:43 +02:00
|
|
|
ref = "0d68d7c857fe301d49cdcd56130e0beea4ecd5aa"; # nixos-unstable
|
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);
|
2021-07-29 00:08:48 +02:00
|
|
|
mkDeploy = hostname: target: { ${hostname} = pkgs.krops.writeDeploy "deploy-${hostname}" {
|
|
|
|
source = source hostname;
|
|
|
|
inherit target;
|
2021-07-29 00:09:32 +02:00
|
|
|
}; };
|
2021-07-29 00:08:48 +02:00
|
|
|
in {}
|
2022-02-22 23:25:46 +01:00
|
|
|
// mkDeploy "core-services-01" "root@10.1.1.20"
|
2021-07-29 00:08:48 +02:00
|
|
|
// mkDeploy "remote-builder-01" "root@nix01.builders.rz.ens.wtf"
|
2022-03-05 23:16:54 +01:00
|
|
|
// mkDeploy "public-cof" "root@beta.rz.ens.wtf"
|
2021-11-13 00:59:59 +01:00
|
|
|
// mkTestsConfig [ "core-services-01" "remote-builder-01" "public-cof" ]
|