mirror of
https://github.com/kmein/niveum
synced 2026-03-22 04:41:07 +01:00
krops: restructure expressions
This commit is contained in:
76
deploy.nix
76
deploy.nix
@@ -1,8 +1,3 @@
|
|||||||
{ catullus-ssh ? "root@catullus.r:22022"
|
|
||||||
, scardanelli-ssh ? "root@scardanelli.r:22022"
|
|
||||||
, homeros-ssh ? "root@homeros.r:22022"
|
|
||||||
, wilde-ssh ? "root@192.168.178.31:22"
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
krops = builtins.fetchGit {
|
krops = builtins.fetchGit {
|
||||||
url = "https://cgit.krebsco.de/krops/";
|
url = "https://cgit.krebsco.de/krops/";
|
||||||
@@ -12,7 +7,14 @@ let
|
|||||||
pkgs = import "${krops}/pkgs" {};
|
pkgs = import "${krops}/pkgs" {};
|
||||||
importJson = (import <nixpkgs> {}).lib.importJSON;
|
importJson = (import <nixpkgs> {}).lib.importJSON;
|
||||||
|
|
||||||
niveum = path: {
|
niveum = {
|
||||||
|
lib.file = toString ./lib;
|
||||||
|
packages.file = toString ./packages;
|
||||||
|
configs.file = toString ./configs;
|
||||||
|
dot.file = toString ./dot;
|
||||||
|
modules.file = toString ./modules;
|
||||||
|
nixos-config.symlink = "system/configuration.nix";
|
||||||
|
|
||||||
nixpkgs.git = {
|
nixpkgs.git = {
|
||||||
url = https://github.com/NixOS/nixpkgs-channels;
|
url = https://github.com/NixOS/nixpkgs-channels;
|
||||||
ref = (importJson ./nixpkgs.json).rev;
|
ref = (importJson ./nixpkgs.json).rev;
|
||||||
@@ -21,19 +23,6 @@ let
|
|||||||
url = https://github.com/NixOS/nixpkgs-channels;
|
url = https://github.com/NixOS/nixpkgs-channels;
|
||||||
ref = "nixos-unstable";
|
ref = "nixos-unstable";
|
||||||
};
|
};
|
||||||
system.file = toString path;
|
|
||||||
lib.file = toString ./lib;
|
|
||||||
packages.file = toString ./packages;
|
|
||||||
configs.file = toString ./configs;
|
|
||||||
dot.file = toString ./dot;
|
|
||||||
modules.file = toString ./modules;
|
|
||||||
|
|
||||||
nixos-config.symlink = "system/configuration.nix";
|
|
||||||
};
|
|
||||||
|
|
||||||
minimal = path: other: lib.evalSource [(niveum path // other)];
|
|
||||||
|
|
||||||
regular = path: name: minimal path {
|
|
||||||
home-manager.git = {
|
home-manager.git = {
|
||||||
url = https://github.com/rycee/home-manager;
|
url = https://github.com/rycee/home-manager;
|
||||||
ref = "2ccbf43";
|
ref = "2ccbf43";
|
||||||
@@ -42,41 +31,24 @@ let
|
|||||||
url = https://cgit.krebsco.de/stockholm;
|
url = https://cgit.krebsco.de/stockholm;
|
||||||
ref = "1340e3fb";
|
ref = "1340e3fb";
|
||||||
};
|
};
|
||||||
secrets.pass = {
|
|
||||||
dir = toString ~/.password-store/niveum/systems;
|
|
||||||
inherit name;
|
|
||||||
};
|
|
||||||
art.file = toString ./art;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systems.scardanelli = pkgs.krops.writeDeploy "deploy-scardanelli" {
|
regularSystem = path: name: extras: {
|
||||||
source = regular ./systems/scardanelli "scardanelli";
|
source = lib.evalSource [
|
||||||
target = scardanelli-ssh;
|
(niveum // extras // {
|
||||||
|
system.file = toString path;
|
||||||
|
secrets.pass = {
|
||||||
|
dir = toString ~/.password-store/systems;
|
||||||
|
inherit name;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
target = "root@${name}:22022";
|
||||||
};
|
};
|
||||||
|
in {
|
||||||
|
scardanelli = pkgs.krops.writeDeploy "deploy-scardanelli" (regularSystem systems/scardanelli "scardanelli" { art.file = toString ./art; });
|
||||||
|
homeros = pkgs.krops.writeDeploy "deploy-homeros" (regularSystem systems/homeros "homeros" { art.file = toString ./art; });
|
||||||
|
wilde = pkgs.krops.writeDeploy "deploy-wilde" (regularSystem systems/wilde "wilde" { art.file = toString ./art; });
|
||||||
|
|
||||||
systems.homeros = pkgs.krops.writeDeploy "deploy-homeros" {
|
catullus = pkgs.krops.writeDeploy "deploy-catullus" (regularSystem systems/catullus "catullus" {});
|
||||||
source = regular ./systems/homeros "homeros";
|
|
||||||
target = homeros-ssh;
|
|
||||||
};
|
|
||||||
|
|
||||||
systems.wilde = pkgs.krops.writeDeploy "deploy-wilde" {
|
|
||||||
source = regular ./systems/wilde "wilde";
|
|
||||||
target = wilde-ssh;
|
|
||||||
};
|
|
||||||
|
|
||||||
systems.catullus = pkgs.krops.writeDeploy "deploy-catullus" {
|
|
||||||
source = minimal ./systems/catullus {
|
|
||||||
secrets.pass = {
|
|
||||||
dir = toString ~/.password-store;
|
|
||||||
name = "catullus";
|
|
||||||
};
|
|
||||||
stockholm.git = {
|
|
||||||
url = https://cgit.krebsco.de/stockholm;
|
|
||||||
ref = "1340e3fb";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
target = catullus-ssh;
|
|
||||||
};
|
|
||||||
in systems // {
|
|
||||||
all = pkgs.writeScript "deploy-all" (lib.concatStringsSep "\n" (lib.attrValues systems));
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user