45 lines
1.2 KiB
Nix
45 lines
1.2 KiB
Nix
|
let
|
||
|
krops = builtins.fetchGit {
|
||
|
url = "https://cgit.krebsco.de/krops/";
|
||
|
};
|
||
|
lib = import "${krops}/lib";
|
||
|
pkgs = import "${krops}/pkgs" {};
|
||
|
|
||
|
source = name: lib.evalSource [
|
||
|
{
|
||
|
config.file = toString ./config/${name};
|
||
|
modules.file = toString ./modules;
|
||
|
nixos-config.symlink = "config/configuration.nix";
|
||
|
secrets.pass = {
|
||
|
dir = toString ~/.password-store/nixin-password-store/krops;
|
||
|
name = "${name}";
|
||
|
};
|
||
|
nixpkgs.git = {
|
||
|
ref = "nixos-24.11";
|
||
|
url = https://github.com/NixOS/nixpkgs-channels;
|
||
|
};
|
||
|
}
|
||
|
];
|
||
|
|
||
|
arachnide = pkgs.krops.writeDeploy "deploy-server-arachnide" {
|
||
|
source = source "arachnide";
|
||
|
target = lib.mkTarget "douzeb@192.168.36.9" // {
|
||
|
port = "144";
|
||
|
sudo = true;
|
||
|
};
|
||
|
# only build the configuration and do not activate it for now (could also use writeTest instead of writeDeploy for doing that)
|
||
|
operation = "build";
|
||
|
};
|
||
|
|
||
|
dromadaire = pkgs.krops.writeDeploy "deploy-server-dromadaire" {
|
||
|
source = source "dromadaire";
|
||
|
target = "root@192.168.36.6";
|
||
|
};
|
||
|
|
||
|
in {
|
||
|
arachnide = arachnide;
|
||
|
dromadaire = dromadaire;
|
||
|
all = pkgs.writeScript "deploy-all-servers"
|
||
|
(lib.concatStringsSep "\n" [ arachnide dromadaire ]);
|
||
|
}
|