infra/krops/krops.nix

93 lines
2.5 KiB
Nix

let
krops = builtins.fetchGit {
url = "https://cgit.krebsco.de/krops/";
};
lib = import "${krops}/lib";
pkgs = import "${krops}/pkgs" {};
dev-vm-source = lib.evalSource [
{
nixpkgs.git = {
ref = "origin/nixos-22.11";
url = https://github.com/NixOS/nixpkgs;
};
nixos-config.file = toString ./dev-vm/configuration.nix;
hardware.file = toString ./dev-vm/hardware.nix;
}
];
ipad-dev-source = lib.evalSource [
{
nixpkgs.git = {
ref = "origin/nixos-22.11";
url = https://github.com/NixOS/nixpkgs;
};
home-manager.git = {
ref = "origin/release-22.11";
url = https://github.com/nix-community/home-manager;
};
nixos-config.file = toString ./ipad-dev/configuration.nix;
"hardware.nix".file = toString ./ipad-dev/hardware.nix;
}
];
nas-source = lib.evalSource [
{
nixpkgs.git = {
ref = "origin/nixos-23.05";
url = https://github.com/NixOS/nixpkgs;
};
home-manager.git = {
ref = "origin/release-23.05";
url = https://github.com/nix-community/home-manager;
};
nixos-config.file = toString ./nas/configuration.nix;
"hardware.nix".file = toString ./nas/hardware.nix;
"n8n.nix".file = toString ./nas/nixpkgs/n8n.nix;
}
];
nas-k3s-source = lib.evalSource [
{
nixpkgs.git = {
ref = "origin/nixos-23.05";
url = https://github.com/NixOS/nixpkgs;
};
nixos-config.file = toString ./nas/k3s/configuration.nix;
"hardware.nix".file = toString ./nas/k3s/hardware.nix;
}
];
seattle-source = lib.evalSource [
{
nixpkgs.git = {
ref = "origin/nixos-unstable";
url = https://github.com/NixOS/nixpkgs;
};
nixos-config.file = toString ./seattle/configuration.nix;
"hardware.nix".file = toString ./seattle/hardware.nix;
}
];
in {
dev-vm = pkgs.krops.writeDeploy "dev-vm" {
source = dev-vm-source;
target = "root@192.168.50.126";
};
ipad-dev = pkgs.krops.writeDeploy "ipad-dev" {
source = ipad-dev-source;
target = "root@143.47.234.244";
};
nas = pkgs.krops.writeDeploy "nas" {
source = nas-source;
target = "root@192.168.50.229";
};
nas-k3s = pkgs.krops.writeDeploy "nas-k3s" {
source = nas-k3s-source;
target = "root@192.168.50.229:22001";
};
seattle = pkgs.krops.writeDeploy "seattle" {
source = seattle-source;
target = "root@192.168.50.146";
};
}