infra/nix/krops.nix
2023-09-05 21:44:01 +01:00

97 lines
2.7 KiB
Nix

let
krops = builtins.fetchGit {
url = "https://cgit.krebsco.de/krops/";
};
lib = import "${krops}/lib";
pkgs = import "${krops}/pkgs" {};
oracle-gitea-runner-source = lib.evalSource [
{
nixpkgs.git = {
ref = "ea95c0917609e5c48023cc7c6141bea2fdf13970";
url = https://github.com/NixOS/nixpkgs;
shallow = true;
};
nixos-config.file = toString ./oracle-gitea-runner/configuration.nix;
"hardware.nix".file = toString ./oracle-gitea-runner/hardware.nix;
}
];
oracle-nix-cache-source = lib.evalSource [
{
nixpkgs.git = {
ref = "66aedfd010204949cb225cf749be08cb13ce1813";
url = https://github.com/NixOS/nixpkgs;
shallow = true;
};
nixos-config.file = toString ./oracle-nix-cache/configuration.nix;
"hardware.nix".file = toString ./oracle-nix-cache/hardware.nix;
}
];
nas-source = lib.evalSource [
{
nixpkgs.git = {
ref = "origin/nixos-unstable";
url = https://github.com/NixOS/nixpkgs;
};
home-manager.git = {
ref = "origin/master";
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;
"dns.db".file = toString ./nas/dns.db;
}
];
seattle-source = lib.evalSource [
{
nixpkgs.git = {
ref = "6e287913f7b1ef537c97aa301b67c34ea46b640f";
url = https://github.com/NixOS/nixpkgs;
shallow = true;
};
nixos-config.file = toString ./seattle/configuration.nix;
"hardware.nix".file = toString ./seattle/hardware.nix;
}
];
glasgow-source = lib.evalSource [
{
nixpkgs.git = {
ref = "6e287913f7b1ef537c97aa301b67c34ea46b640f";
url = https://github.com/NixOS/nixpkgs;
shallow = true;
};
nixos-config.file = toString ./glasgow/configuration.nix;
"hardware.nix".file = toString ./glasgow/hardware.nix;
}
];
in {
oracle-gitea-runner = pkgs.krops.writeDeploy "oracle-gitea-runner" {
source = oracle-gitea-runner-source;
target = "root@143.47.229.209";
};
oracle-nginx-funnel = pkgs.krops.writeDeploy "oracle-nginx-funnel" {
source = oracle-nix-cache-source;
target = "root@141.147.109.157";
};
nas = pkgs.krops.writeDeploy "nas" {
source = nas-source;
target = "root@192.168.50.229";
};
seattle = pkgs.krops.writeDeploy "seattle" {
source = seattle-source;
target = "root@seattle";
};
glasgow = pkgs.krops.writeDeploy "glasgow" {
source = glasgow-source;
target = "root@192.168.50.144";
};
}