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"); this-host.file = toString (./hosts + "/${path}"); 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.32"; ledstripes = deployContainer "ledstripes" "172.22.99.168"; freifunk = deployContainer "freifunk" "172.20.72.40"; kibana = deployContainer "kibana" "172.20.73.44"; glotzbert = pkgs.krops.writeDeploy "glotzbert" { source = hostSource "glotzbert"; target = lib.mkTarget "k-ot@glotzbert.hq.c3d2.de" // { sudo = true; }; }; pulsebert = pkgs.krops.writeDeploy "pulsebert" { source = hostSource "pulsebert"; target = lib.mkTarget "k-ot@pulsebert.hq.c3d2.de" // { sudo = true; }; }; }