33 lines
973 B
Nix
33 lines
973 B
Nix
|
let
|
||
|
krops = builtins.fetchGit {
|
||
|
url = "https://cgit.krebsco.de/krops/";
|
||
|
};
|
||
|
lib = import "${krops}/lib";
|
||
|
pkgs = import "${krops}/pkgs" {};
|
||
|
|
||
|
hostSource = path:
|
||
|
lib.evalSource [ {
|
||
|
nixpkgs.git = {
|
||
|
ref = "origin/nixos-20.03";
|
||
|
url = "https://github.com/NixOS/nixpkgs-channels.git";
|
||
|
};
|
||
|
nixpkgs-unstable.git = {
|
||
|
ref = "origin/master";
|
||
|
url = "https://github.com/NixOS/nixpkgs.git";
|
||
|
};
|
||
|
nixos-config.file = toString (./hosts + "/${path}/configuration.nix");
|
||
|
lib.file = toString ./lib;
|
||
|
secrets.file = toString ./secrets;
|
||
|
"host-registry.nix".file = toString ./host-registry.nix;
|
||
|
} ];
|
||
|
|
||
|
deployContainer = containerName: host:
|
||
|
pkgs.krops.writeDeploy containerName {
|
||
|
source = hostSource "containers/${containerName}";
|
||
|
target = "root@${host}";
|
||
|
};
|
||
|
in {
|
||
|
scrape = deployContainer "scrape" "172.20.73.28";
|
||
|
ledstripes = deployContainer "ledstripes" "172.22.99.168";
|
||
|
}
|