Compare commits
46 Commits
issue47
...
hostbuilde
| Author | SHA1 | Date | |
|---|---|---|---|
| af11810935 | |||
| 81f73a0704 | |||
| 7730163b84 | |||
| 725efc3e0a | |||
| 724f14cfcd | |||
| cf3bfa1784 | |||
| c71d7959f2 | |||
| 155e78b519 | |||
| c54f04cb62 | |||
| 197a8427b7 | |||
| 1877f6dc9c | |||
| c47e93170f | |||
| eea5d6924d | |||
| 468106677c | |||
| df4d769f82 | |||
| 249eebf164 | |||
| e3bcd250e0 | |||
| 1b871f3860 | |||
| 3564436dfe | |||
| 4744324385 | |||
| 88ef307a65 | |||
| dec968a4db | |||
| 283dc51d67 | |||
|
|
f4a6c40cd2 | ||
|
|
23caa27d4e | ||
|
|
d6aee8657b | ||
|
|
e7e05327e4 | ||
| 1fc3538e03 | |||
|
|
1ebee6d886 | ||
|
|
94e439bf0b | ||
|
|
e50f3349ba | ||
|
|
18b747a7df | ||
|
|
ea6e019b64 | ||
|
|
8581f762a2 | ||
|
|
b223f0cb0c | ||
|
|
9ba607ce16 | ||
|
|
34c2661c53 | ||
|
|
211799b6b9 | ||
|
|
543c4ed49e | ||
|
|
27085dd3e6 | ||
|
|
8076956982 | ||
| 26829f9255 | |||
| 0d93cad9d4 | |||
| 02a57d98d0 | |||
| 4553c2c069 | |||
| 3f3dca3c7f |
8
flake.lock
generated
8
flake.lock
generated
@@ -341,11 +341,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737548421,
|
"lastModified": 1736184101,
|
||||||
"narHash": "sha256-gmlqJdC+v86vXc2yMhiza1mvsqh3vMfrEsiw+tV5MXg=",
|
"narHash": "sha256-HAX+TkDXzyNp6SAsKwjNFql7KzAtxximpQSv+GmP8KQ=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "c5fff78c83959841ac724980a13597dcfa6dc26d",
|
"rev": "9cdab949f44301553e3817cf1f38287ad947e00c",
|
||||||
"revCount": 29,
|
"revCount": 28,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.dynamicdiscord.de/kalipso/tasklist"
|
"url": "https://git.dynamicdiscord.de/kalipso/tasklist"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ keys:
|
|||||||
- &machine_durruti age1xu6kxpf8p0r8d6sgyl0m20p5hmw35nserl7rejuzm66eql0ur4mq03u0vp
|
- &machine_durruti age1xu6kxpf8p0r8d6sgyl0m20p5hmw35nserl7rejuzm66eql0ur4mq03u0vp
|
||||||
- &machine_vpn age1v6uxwej4nlrpfanr9js7x6059mtvyg4fw50pzt0a2kt3ahk7edlslafeuh
|
- &machine_vpn age1v6uxwej4nlrpfanr9js7x6059mtvyg4fw50pzt0a2kt3ahk7edlslafeuh
|
||||||
- &machine_fanny age14dpm6vaycd6u34dkndcktpamqgdyj4aqccjnl5533dsza05hxuds0tjfnf
|
- &machine_fanny age14dpm6vaycd6u34dkndcktpamqgdyj4aqccjnl5533dsza05hxuds0tjfnf
|
||||||
- &machine_nextcloud age1w07s4y2uh0xd322ralyyh79545lvxzqncd0s65q9cx4ttlqv5u9s7y78gr
|
|
||||||
#this dummy key is used for testing.
|
#this dummy key is used for testing.
|
||||||
- &machine_dummy age18jn5mrfs4gqrnv0e2sxsgh3kq4sgxx39hwr8z7mz9kt7wlgaasjqlr88ng
|
- &machine_dummy age18jn5mrfs4gqrnv0e2sxsgh3kq4sgxx39hwr8z7mz9kt7wlgaasjqlr88ng
|
||||||
creation_rules:
|
creation_rules:
|
||||||
@@ -85,18 +84,12 @@ creation_rules:
|
|||||||
- *admin_kalipso_dsktp
|
- *admin_kalipso_dsktp
|
||||||
age:
|
age:
|
||||||
- *admin_atlan
|
- *admin_atlan
|
||||||
|
|
||||||
- path_regex: nextcloud/secrets.yaml$
|
- path_regex: nextcloud/secrets.yaml$
|
||||||
key_groups:
|
key_groups:
|
||||||
- pgp:
|
- pgp:
|
||||||
- *admin_kalipso
|
- *admin_kalipso
|
||||||
- *admin_kalipso_dsktp
|
- *admin_kalipso_dsktp
|
||||||
|
- *machine_durruti
|
||||||
age:
|
age:
|
||||||
- *admin_atlan
|
- *admin_atlan
|
||||||
- *machine_nextcloud
|
|
||||||
- path_regex: overwatch/secrets.yaml$
|
|
||||||
key_groups:
|
|
||||||
- pgp:
|
|
||||||
- *admin_kalipso
|
|
||||||
- *admin_kalipso_dsktp
|
|
||||||
age:
|
|
||||||
- *admin_atlan
|
|
||||||
205
machines/configuration.nix
Normal file
205
machines/configuration.nix
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
{ self
|
||||||
|
, nixpkgs-unstable
|
||||||
|
, nixpkgs
|
||||||
|
, sops-nix
|
||||||
|
, inputs
|
||||||
|
, microvm
|
||||||
|
, nixos-hardware
|
||||||
|
, home-manager
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
nixosSystem = nixpkgs.lib.makeOverridable nixpkgs.lib.nixosSystem;
|
||||||
|
nixosSystemUnstable = nixpkgs-unstable.lib.makeOverridable nixpkgs-unstable.lib.nixosSystem;
|
||||||
|
|
||||||
|
baseModules = [
|
||||||
|
# make flake inputs accessiable in NixOS
|
||||||
|
{ _module.args.inputs = inputs; }
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
({ pkgs, ... }: {
|
||||||
|
nix = {
|
||||||
|
extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
'';
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
substituters = [
|
||||||
|
"https://cache.dynamicdiscord.de"
|
||||||
|
"https://cache.nixos.org/"
|
||||||
|
];
|
||||||
|
trusted-public-keys = [
|
||||||
|
"cache.dynamicdiscord.de:DKueZicqi2NhJJXz9MYgUbiyobMs10fTyHCgAUibRP4="
|
||||||
|
];
|
||||||
|
trusted-users = [ "root" "@wheel" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
sops-nix.nixosModules.sops
|
||||||
|
microvm.nixosModules.microvm
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
defaultModules = baseModules;
|
||||||
|
|
||||||
|
makeMicroVM = hostName: ipv4Addr: macAddr: modules: [
|
||||||
|
self.nixosModules.malobeo.metrics
|
||||||
|
{
|
||||||
|
microvm = {
|
||||||
|
hypervisor = "cloud-hypervisor";
|
||||||
|
mem = 2560;
|
||||||
|
shares = [
|
||||||
|
{
|
||||||
|
source = "/nix/store";
|
||||||
|
mountPoint = "/nix/.ro-store";
|
||||||
|
tag = "store";
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "store.socket";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source = "/var/lib/microvms/${hostName}/etc";
|
||||||
|
mountPoint = "/etc";
|
||||||
|
tag = "etc";
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "etc.socket";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source = "/var/lib/microvms/${hostName}/var";
|
||||||
|
mountPoint = "/var";
|
||||||
|
tag = "var";
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "var.socket";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
interfaces = [
|
||||||
|
{
|
||||||
|
type = "tap";
|
||||||
|
id = "vm-${hostName}";
|
||||||
|
mac = "${macAddr}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
malobeo.metrics = {
|
||||||
|
enable = true;
|
||||||
|
enablePromtail = true;
|
||||||
|
logNginx = false;
|
||||||
|
lokiHost = "10.0.0.14";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.network.enable = true;
|
||||||
|
|
||||||
|
systemd.network.networks."20-lan" = {
|
||||||
|
matchConfig.Type = "ether";
|
||||||
|
networkConfig = {
|
||||||
|
Address = [ "${ipv4Addr}/24" ];
|
||||||
|
Gateway = "10.0.0.1";
|
||||||
|
DNS = ["1.1.1.1"];
|
||||||
|
DHCP = "no";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
] ++ defaultModules ++ modules;
|
||||||
|
|
||||||
|
inputsMod = inputs // { malobeo = self; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
louise = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
modules = defaultModules ++ [
|
||||||
|
./louise/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
bakunin = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
modules = defaultModules ++ [
|
||||||
|
./bakunin/configuration.nix
|
||||||
|
inputs.disko.nixosModules.disko
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
lucia = nixosSystem {
|
||||||
|
system = "aarch64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
modules = defaultModules ++ [
|
||||||
|
./lucia/configuration.nix
|
||||||
|
./lucia/hardware_configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
fanny = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs.inputs = inputsMod;
|
||||||
|
modules = defaultModules ++ [
|
||||||
|
self.nixosModules.malobeo.vpn
|
||||||
|
./fanny/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
durruti = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
specialArgs.self = self;
|
||||||
|
modules = makeMicroVM "durruti" "10.0.0.5" "52:DA:0D:F9:EF:F9" [
|
||||||
|
./durruti/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
vpn = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
specialArgs.self = self;
|
||||||
|
modules = makeMicroVM "vpn" "10.0.0.10" "D0:E5:CA:F0:D7:E6" [
|
||||||
|
self.nixosModules.malobeo.vpn
|
||||||
|
./vpn/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
infradocs = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
specialArgs.self = self;
|
||||||
|
modules = makeMicroVM "infradocs" "10.0.0.11" "D0:E5:CA:F0:D7:E7" [
|
||||||
|
self.nixosModules.malobeo.vpn
|
||||||
|
./infradocs/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
uptimekuma = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
specialArgs.self = self;
|
||||||
|
modules = makeMicroVM "uptimekuma" "10.0.0.12" "D0:E5:CA:F0:D7:E8" [
|
||||||
|
./uptimekuma/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
nextcloud = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
specialArgs.self = self;
|
||||||
|
modules = makeMicroVM "nextcloud" "10.0.0.13" "D0:E5:CA:F0:D7:E9" [
|
||||||
|
./nextcloud/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
overwatch = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
specialArgs.self = self;
|
||||||
|
modules = makeMicroVM "overwatch" "10.0.0.14" "D0:E5:CA:F0:D7:E0" [
|
||||||
|
./overwatch/configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
testvm = nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
specialArgs.self = self;
|
||||||
|
modules = defaultModules ++ [ ./testvm ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ config, self, lib, pkgs, inputs, ... }:
|
{ config, lib, pkgs, inputs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
@@ -17,21 +17,15 @@ with lib;
|
|||||||
];
|
];
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
self.nixosModules.malobeo.metrics
|
|
||||||
inputs.tasklist.nixosModules.malobeo-tasklist
|
inputs.tasklist.nixosModules.malobeo-tasklist
|
||||||
|
|
||||||
|
./documentation.nix
|
||||||
|
|
||||||
../modules/malobeo_user.nix
|
../modules/malobeo_user.nix
|
||||||
../modules/sshd.nix
|
../modules/sshd.nix
|
||||||
../modules/minimal_tools.nix
|
../modules/minimal_tools.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
malobeo.metrics = {
|
|
||||||
enable = true;
|
|
||||||
enablePromtail = true;
|
|
||||||
logNginx = true;
|
|
||||||
lokiHost = "10.0.0.14";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.malobeo-tasklist.enable = true;
|
services.malobeo-tasklist.enable = true;
|
||||||
|
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
system.stateVersion = "22.11"; # Did you read the comment?
|
||||||
|
|||||||
@@ -43,36 +43,6 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."cloud.malobeo.org" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME= true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://10.0.0.10";
|
|
||||||
extraConfig = ''
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."grafana.malobeo.org" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME= true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://10.0.0.10";
|
|
||||||
extraConfig = ''
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."tasklist.malobeo.org" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME= true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://10.0.0.10";
|
|
||||||
extraConfig = ''
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."status.malobeo.org" = {
|
services.nginx.virtualHosts."status.malobeo.org" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME= true;
|
enableACME= true;
|
||||||
@@ -82,5 +52,17 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."tasklist.malobeo.org" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME= true;
|
||||||
|
locations."/".proxyPass = "http://${cfg.host_ip}:8080";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."booking.dynamicdiscord.de" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME= true;
|
||||||
|
locations."/".proxyPass = "http://${cfg.host_ip}:80";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,20 +13,11 @@ in
|
|||||||
../modules/sshd.nix
|
../modules/sshd.nix
|
||||||
../modules/minimal_tools.nix
|
../modules/minimal_tools.nix
|
||||||
../modules/autoupdate.nix
|
../modules/autoupdate.nix
|
||||||
inputs.self.nixosModules.malobeo.vpn
|
|
||||||
inputs.self.nixosModules.malobeo.initssh
|
inputs.self.nixosModules.malobeo.initssh
|
||||||
inputs.self.nixosModules.malobeo.disko
|
inputs.self.nixosModules.malobeo.disko
|
||||||
inputs.self.nixosModules.malobeo.microvm
|
inputs.self.nixosModules.malobeo.microvm
|
||||||
inputs.self.nixosModules.malobeo.metrics
|
|
||||||
];
|
];
|
||||||
|
|
||||||
malobeo.metrics = {
|
|
||||||
enable = true;
|
|
||||||
enablePromtail = true;
|
|
||||||
logNginx = true;
|
|
||||||
lokiHost = "10.0.0.14";
|
|
||||||
};
|
|
||||||
|
|
||||||
malobeo.autoUpdate = {
|
malobeo.autoUpdate = {
|
||||||
enable = true;
|
enable = true;
|
||||||
url = "https://hydra.dynamicdiscord.de";
|
url = "https://hydra.dynamicdiscord.de";
|
||||||
@@ -35,14 +26,7 @@ in
|
|||||||
cacheurl = "https://cache.dynamicdiscord.de";
|
cacheurl = "https://cache.dynamicdiscord.de";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix = {
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
settings.experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
#always update microvms
|
|
||||||
extraOptions = ''
|
|
||||||
tarball-ttl = 0
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
malobeo.disks = {
|
malobeo.disks = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -69,15 +53,9 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
services.malobeo.microvm.enableHostBridge = true;
|
services.malobeo.microvm.enableHostBridge = true;
|
||||||
services.malobeo.microvm.deployHosts = [ "overwatch" "infradocs" "nextcloud" "durruti" ];
|
services.malobeo.microvm.deployHosts = [ "infradocs" "nextcloud" "overwatch" ];
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
nat = {
|
|
||||||
enable = true;
|
|
||||||
externalInterface = "enp1s0";
|
|
||||||
internalInterfaces = [ "microvm" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
firewall = {
|
firewall = {
|
||||||
allowedTCPPorts = [ 80 ];
|
allowedTCPPorts = [ 80 ];
|
||||||
};
|
};
|
||||||
@@ -89,7 +67,6 @@ in
|
|||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://10.0.0.11:9000";
|
proxyPass = "http://10.0.0.11:9000";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -98,25 +75,6 @@ in
|
|||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://10.0.0.13";
|
proxyPass = "http://10.0.0.13";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualHosts."grafana.malobeo.org" = {
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://10.0.0.14";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualHosts."tasklist.malobeo.org" = {
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://10.0.0.5:8080";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,75 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
malobeo = {
|
|
||||||
hosts = {
|
|
||||||
louise = {
|
|
||||||
type = "host";
|
|
||||||
};
|
|
||||||
|
|
||||||
bakunin = {
|
|
||||||
type = "host";
|
|
||||||
};
|
|
||||||
|
|
||||||
fanny = {
|
|
||||||
type = "host";
|
|
||||||
};
|
|
||||||
|
|
||||||
lucia = {
|
|
||||||
type = "rpi";
|
|
||||||
};
|
|
||||||
|
|
||||||
durruti = {
|
|
||||||
type = "microvm";
|
|
||||||
network = {
|
|
||||||
address = "10.0.0.5";
|
|
||||||
mac = "52:DA:0D:F9:EF:F9";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
vpn = {
|
|
||||||
type = "microvm";
|
|
||||||
network = {
|
|
||||||
address = "10.0.0.10";
|
|
||||||
mac = "D0:E5:CA:F0:D7:E6";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
infradocs = {
|
|
||||||
type = "microvm";
|
|
||||||
network = {
|
|
||||||
address = "10.0.0.11";
|
|
||||||
mac = "D0:E5:CA:F0:D7:E7";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
uptimekuma = {
|
|
||||||
type = "microvm";
|
|
||||||
network = {
|
|
||||||
address = "10.0.0.12";
|
|
||||||
mac = "D0:E5:CA:F0:D7:E8";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nextcloud = {
|
|
||||||
type = "microvm";
|
|
||||||
network = {
|
|
||||||
address = "10.0.0.13";
|
|
||||||
mac = "D0:E5:CA:F0:D7:E9";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
overwatch = {
|
|
||||||
type = "microvm";
|
|
||||||
network = {
|
|
||||||
address = "10.0.0.14";
|
|
||||||
mac = "D0:E5:CA:F0:D7:E0";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
testvm = {
|
|
||||||
type = "host";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{ self, config, lib, pkgs, inputs, ... }:
|
{ config, lib, pkgs, inputs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
@@ -9,18 +9,16 @@ with lib;
|
|||||||
};
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
inputs.malobeo.nixosModules.malobeo.metrics
|
|
||||||
../durruti/documentation.nix
|
../durruti/documentation.nix
|
||||||
../modules/malobeo_user.nix
|
../modules/malobeo_user.nix
|
||||||
../modules/sshd.nix
|
../modules/sshd.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
malobeo.metrics = {
|
networking.firewall.allowedTCPPorts = [ 9002 ];
|
||||||
enable = true;
|
|
||||||
enablePromtail = true;
|
malobeo.metrics.logNginx = lib.mkForce true;
|
||||||
logNginx = true;
|
|
||||||
lokiHost = "10.0.0.14";
|
users.users.promtail.extraGroups = [ "nginx" "systemd-journal" ];
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
system.stateVersion = "22.11"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ in
|
|||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
./hardware_configuration.nix
|
|
||||||
../modules/malobeo_user.nix
|
../modules/malobeo_user.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
63
machines/modules/disko/btrfs-laptop.nix
Normal file
63
machines/modules/disko/btrfs-laptop.nix
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
{ config, self, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.disko.nixosModules.disko
|
||||||
|
];
|
||||||
|
|
||||||
|
# https://github.com/nix-community/disko/blob/master/example/luks-btrfs-subvolumes.nix
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
type = "disk";
|
||||||
|
# When using disko-install, we will overwrite this value from the commandline
|
||||||
|
device = "/dev/disk/by-id/some-disk-id";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
size = "512M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = [ "umask=0077" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
luks = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "crypted";
|
||||||
|
passwordFile = /tmp/secret.key; # Interactive
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
extraArgs = [ "-f" ];
|
||||||
|
subvolumes = {
|
||||||
|
"/root" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
};
|
||||||
|
"/home" = {
|
||||||
|
mountpoint = "/home";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
};
|
||||||
|
"/nix" = {
|
||||||
|
mountpoint = "/nix";
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
};
|
||||||
|
"/swap" = {
|
||||||
|
mountpoint = "/.swapvol";
|
||||||
|
swap.swapfile.size = "20M";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -187,7 +187,6 @@ in
|
|||||||
postCreateHook = lib.mkIf cfg.encryption ''
|
postCreateHook = lib.mkIf cfg.encryption ''
|
||||||
zfs set keylocation="prompt" zroot/encrypted;
|
zfs set keylocation="prompt" zroot/encrypted;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
"encrypted/root" = {
|
"encrypted/root" = {
|
||||||
type = "zfs_fs";
|
type = "zfs_fs";
|
||||||
@@ -245,12 +244,13 @@ in
|
|||||||
};
|
};
|
||||||
# use this to read the key during boot
|
# use this to read the key during boot
|
||||||
postCreateHook = lib.mkIf cfg.encryption ''
|
postCreateHook = lib.mkIf cfg.encryption ''
|
||||||
zfs set keylocation="file:///root/secret.key" storage/encrypted;
|
zfs set keylocation="prompt" storage/encrypted;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
"encrypted/data" = {
|
"encrypted/data" = {
|
||||||
type = "zfs_fs";
|
type = "zfs_fs";
|
||||||
mountpoint = "/data";
|
mountpoint = "/data";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
};
|
};
|
||||||
reserved = {
|
reserved = {
|
||||||
# for cow delete if pool is full
|
# for cow delete if pool is full
|
||||||
@@ -267,7 +267,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
boot.zfs.devNodes = lib.mkDefault cfg.devNodes;
|
boot.zfs.devNodes = lib.mkDefault cfg.devNodes;
|
||||||
boot.zfs.extraPools = lib.mkIf cfg.storage.enable [ "storage" ];
|
|
||||||
fileSystems."/".neededForBoot = true;
|
fileSystems."/".neededForBoot = true;
|
||||||
fileSystems."/etc".neededForBoot = true;
|
fileSystems."/etc".neededForBoot = true;
|
||||||
fileSystems."/boot".neededForBoot = true;
|
fileSystems."/boot".neededForBoot = true;
|
||||||
|
|||||||
@@ -1,243 +0,0 @@
|
|||||||
{ self
|
|
||||||
, nixpkgs-unstable
|
|
||||||
, nixpkgs
|
|
||||||
, sops-nix
|
|
||||||
, inputs
|
|
||||||
, hosts
|
|
||||||
, ...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
nixosSystem = nixpkgs.lib.makeOverridable nixpkgs.lib.nixosSystem;
|
|
||||||
nixosSystemUnstable = nixpkgs-unstable.lib.makeOverridable nixpkgs-unstable.lib.nixosSystem;
|
|
||||||
|
|
||||||
baseModules = [
|
|
||||||
# make flake inputs accessiable in NixOS
|
|
||||||
{ _module.args.inputs = inputs; }
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
({ pkgs, ... }: {
|
|
||||||
nix = {
|
|
||||||
extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
'';
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
substituters = [
|
|
||||||
"https://cache.dynamicdiscord.de"
|
|
||||||
"https://cache.nixos.org/"
|
|
||||||
];
|
|
||||||
trusted-public-keys = [
|
|
||||||
"cache.dynamicdiscord.de:DKueZicqi2NhJJXz9MYgUbiyobMs10fTyHCgAUibRP4="
|
|
||||||
];
|
|
||||||
trusted-users = [ "root" "@wheel" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
||||||
sops-nix.nixosModules.sops
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
defaultModules = baseModules;
|
|
||||||
|
|
||||||
makeMicroVM = hostName: ipv4Addr: macAddr: modules: [
|
|
||||||
{
|
|
||||||
microvm = {
|
|
||||||
hypervisor = "cloud-hypervisor";
|
|
||||||
mem = 2560;
|
|
||||||
shares = [
|
|
||||||
{
|
|
||||||
source = "/nix/store";
|
|
||||||
mountPoint = "/nix/.ro-store";
|
|
||||||
tag = "store";
|
|
||||||
proto = "virtiofs";
|
|
||||||
socket = "store.socket";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
source = "/var/lib/microvms/${hostName}/etc";
|
|
||||||
mountPoint = "/etc";
|
|
||||||
tag = "etc";
|
|
||||||
proto = "virtiofs";
|
|
||||||
socket = "etc.socket";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
source = "/var/lib/microvms/${hostName}/var";
|
|
||||||
mountPoint = "/var";
|
|
||||||
tag = "var";
|
|
||||||
proto = "virtiofs";
|
|
||||||
socket = "var.socket";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
interfaces = [
|
|
||||||
{
|
|
||||||
type = "tap";
|
|
||||||
id = "vm-${hostName}";
|
|
||||||
mac = "${macAddr}";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.network.enable = true;
|
|
||||||
|
|
||||||
systemd.network.networks."20-lan" = {
|
|
||||||
matchConfig.Type = "ether";
|
|
||||||
networkConfig = {
|
|
||||||
Address = [ "${ipv4Addr}/24" ];
|
|
||||||
Gateway = "10.0.0.1";
|
|
||||||
DNS = ["1.1.1.1"];
|
|
||||||
DHCP = "no";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
] ++ defaultModules ++ modules;
|
|
||||||
|
|
||||||
inputsMod = inputs // { malobeo = self; };
|
|
||||||
|
|
||||||
|
|
||||||
vmMicroVMOverwrites = hostname: options: {
|
|
||||||
microvm = rec {
|
|
||||||
mem = pkgs.lib.mkForce 4096;
|
|
||||||
hypervisor = pkgs.lib.mkForce "qemu";
|
|
||||||
socket = pkgs.lib.mkForce null;
|
|
||||||
|
|
||||||
|
|
||||||
#needed for hosts that deploy imperative microvms (for example fanny)
|
|
||||||
writableStoreOverlay = pkgs.lib.mkIf options.writableStore "/nix/.rw-store";
|
|
||||||
volumes = pkgs.lib.mkIf options.writableStore [ {
|
|
||||||
image = "nix-store-overlay.img";
|
|
||||||
mountPoint = writableStoreOverlay;
|
|
||||||
size = 2048;
|
|
||||||
} ];
|
|
||||||
|
|
||||||
shares = pkgs.lib.mkForce (pkgs.lib.optionals (!options.writableStore) [
|
|
||||||
{
|
|
||||||
tag = "ro-store";
|
|
||||||
source = "/nix/store";
|
|
||||||
mountPoint = "/nix/.ro-store";
|
|
||||||
}
|
|
||||||
] ++ pkgs.lib.optionals (options.varPath != "") [
|
|
||||||
{
|
|
||||||
source = "${options.varPath}";
|
|
||||||
securityModel = "mapped";
|
|
||||||
mountPoint = "/var";
|
|
||||||
tag = "var";
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
interfaces = pkgs.lib.mkIf (!options.withNetworking) (pkgs.lib.mkForce [{
|
|
||||||
type = "user";
|
|
||||||
id = "eth0";
|
|
||||||
mac = "02:23:de:ad:be:ef";
|
|
||||||
}]);
|
|
||||||
|
|
||||||
#if networking is disabled forward port 80 to still have access to webservices
|
|
||||||
forwardPorts = pkgs.lib.mkIf (!options.withNetworking && options.fwdPort != 0) (pkgs.lib.mkForce [
|
|
||||||
{ from = "host"; host.port = options.fwdPort; guest.port = 80; }
|
|
||||||
]);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems = {
|
|
||||||
"/".fsType = pkgs.lib.mkForce "tmpfs";
|
|
||||||
|
|
||||||
# prometheus uses a memory mapped file which doesnt seem supported by 9p shares
|
|
||||||
# therefore we mount a tmpfs inside the datadir
|
|
||||||
"/var/lib/prometheus2/data" = pkgs.lib.mkIf (hostname == "overwatch" && options.varPath != "") (pkgs.lib.mkForce {
|
|
||||||
fsType = pkgs.lib.mkForce "tmpfs";
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.isContainer = pkgs.lib.mkForce false;
|
|
||||||
services.timesyncd.enable = false;
|
|
||||||
users.users.root.password = "";
|
|
||||||
services.getty.helpLine = ''
|
|
||||||
Log in as "root" with an empty password.
|
|
||||||
Use "reboot" to shut qemu down.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
vmDiskoOverwrites = {
|
|
||||||
boot.initrd = {
|
|
||||||
secrets = pkgs.lib.mkForce {};
|
|
||||||
network.ssh.enable = pkgs.lib.mkForce false;
|
|
||||||
};
|
|
||||||
|
|
||||||
malobeo.disks.enable = pkgs.lib.mkForce false;
|
|
||||||
networking.hostId = "a3c3101f";
|
|
||||||
};
|
|
||||||
|
|
||||||
vmSopsOverwrites = host: {
|
|
||||||
sops.defaultSopsFile = pkgs.lib.mkForce ../${host}/dummy.yaml;
|
|
||||||
|
|
||||||
environment.etc = {
|
|
||||||
devHostKey = {
|
|
||||||
source = ../secrets/devkey_ed25519;
|
|
||||||
mode = "0600";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.openssh.hostKeys = [{
|
|
||||||
path = "/etc/devHostKey";
|
|
||||||
type = "ed25519";
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
|
|
||||||
vmNestedMicroVMOverwrites = host: sopsDummy: {
|
|
||||||
|
|
||||||
services.malobeo.microvm.deployHosts = pkgs.lib.mkForce [];
|
|
||||||
microvm.vms =
|
|
||||||
let
|
|
||||||
# Map the values to each hostname to then generate an Attrset using listToAttrs
|
|
||||||
mapperFunc = name: { inherit name; value = {
|
|
||||||
specialArgs.inputs = inputsMod;
|
|
||||||
specialArgs.self = self;
|
|
||||||
config = {
|
|
||||||
imports = (makeMicroVM "${name}"
|
|
||||||
"${hosts.malobeo.hosts.${name}.network.address}"
|
|
||||||
"${hosts.malobeo.hosts.${name}.network.mac}" [
|
|
||||||
../${name}/configuration.nix
|
|
||||||
(vmMicroVMOverwrites name {
|
|
||||||
withNetworking = true;
|
|
||||||
varPath = "";
|
|
||||||
writableStore = false; })
|
|
||||||
(if sopsDummy then (vmSopsOverwrites name) else {})
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
}; };
|
|
||||||
in
|
|
||||||
builtins.listToAttrs (map mapperFunc self.nixosConfigurations.${host}.config.services.malobeo.microvm.deployHosts);
|
|
||||||
};
|
|
||||||
|
|
||||||
buildVM = host: networking: sopsDummy: disableDisko: varPath: writableStore: fwdPort: (self.nixosConfigurations.${host}.extendModules {
|
|
||||||
modules = [
|
|
||||||
(vmMicroVMOverwrites host {
|
|
||||||
withNetworking = networking;
|
|
||||||
varPath = "${varPath}";
|
|
||||||
writableStore = writableStore;
|
|
||||||
fwdPort = fwdPort; })
|
|
||||||
(if sopsDummy then (vmSopsOverwrites host) else {})
|
|
||||||
(if disableDisko then vmDiskoOverwrites else {})
|
|
||||||
] ++ pkgs.lib.optionals (hosts.malobeo.hosts.${host}.type != "microvm") [
|
|
||||||
inputs.microvm.nixosModules.microvm
|
|
||||||
] ++ pkgs.lib.optionals (self.nixosConfigurations.${host}.config ? services.malobeo.microvm.deployHosts) [
|
|
||||||
(vmNestedMicroVMOverwrites host sopsDummy)
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
buildHost = hosts: (builtins.mapAttrs (host: settings: nixosSystem {
|
|
||||||
system = if (settings.type == "rpi") then "aarch64-linux" else "x86_64-linux";
|
|
||||||
specialArgs.inputs = inputsMod;
|
|
||||||
specialArgs.self = self;
|
|
||||||
modules = (if (settings.type != "microvm") then
|
|
||||||
defaultModules ++ [ ../${host}/configuration.nix ]
|
|
||||||
else
|
|
||||||
makeMicroVM "${host}" "${settings.network.address}" "${settings.network.mac}" [
|
|
||||||
inputs.microvm.nixosModules.microvm
|
|
||||||
../${host}/configuration.nix
|
|
||||||
]);
|
|
||||||
}) hosts);
|
|
||||||
}
|
|
||||||
@@ -30,7 +30,9 @@ in
|
|||||||
loader.efi.canTouchEfiVariables = true;
|
loader.efi.canTouchEfiVariables = true;
|
||||||
supportedFilesystems = [ "vfat" "zfs" ];
|
supportedFilesystems = [ "vfat" "zfs" ];
|
||||||
zfs = {
|
zfs = {
|
||||||
|
forceImportAll = true;
|
||||||
requestEncryptionCredentials = true;
|
requestEncryptionCredentials = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
initrd = {
|
initrd = {
|
||||||
availableKernelModules = cfg.ethernetDrivers;
|
availableKernelModules = cfg.ethernetDrivers;
|
||||||
|
|||||||
@@ -86,6 +86,12 @@ in
|
|||||||
in
|
in
|
||||||
builtins.listToAttrs (map mapperFunc cfg.deployHosts);
|
builtins.listToAttrs (map mapperFunc cfg.deployHosts);
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = builtins.concatLists (map (name: [
|
||||||
|
"d /var/lib/microvms/${name}/var 0755 root root - -"
|
||||||
|
"d /var/lib/microvms/${name}/etc 0755 root root - -"
|
||||||
|
"d /${name} 0755 root root - -"
|
||||||
|
]) cfg.deployHosts);
|
||||||
|
|
||||||
systemd.services = builtins.foldl' (services: name: services // {
|
systemd.services = builtins.foldl' (services: name: services // {
|
||||||
"microvm-update@${name}" = {
|
"microvm-update@${name}" = {
|
||||||
description = "Update MicroVMs automatically";
|
description = "Update MicroVMs automatically";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ config, self, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
@@ -17,20 +17,12 @@ with lib;
|
|||||||
};
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
self.nixosModules.malobeo.metrics
|
|
||||||
../modules/malobeo_user.nix
|
../modules/malobeo_user.nix
|
||||||
../modules/sshd.nix
|
../modules/sshd.nix
|
||||||
../modules/minimal_tools.nix
|
../modules/minimal_tools.nix
|
||||||
../modules/autoupdate.nix
|
../modules/autoupdate.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
malobeo.metrics = {
|
|
||||||
enable = true;
|
|
||||||
enablePromtail = true;
|
|
||||||
logNginx = true;
|
|
||||||
lokiHost = "10.0.0.14";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.nextcloud30;
|
package = pkgs.nextcloud30;
|
||||||
@@ -46,7 +38,7 @@ with lib;
|
|||||||
};
|
};
|
||||||
extraAppsEnable = true;
|
extraAppsEnable = true;
|
||||||
extraApps = {
|
extraApps = {
|
||||||
inherit (config.services.nextcloud.package.packages.apps) contacts calendar deck polls;
|
inherit (config.services.nextcloud.package.packages.apps) contacts calendar;
|
||||||
collectives = pkgs.fetchNextcloudApp {
|
collectives = pkgs.fetchNextcloudApp {
|
||||||
sha256 = "sha256-cj/8FhzxOACJaUEu0eG9r7iAQmnOG62yFHeyUICalFY=";
|
sha256 = "sha256-cj/8FhzxOACJaUEu0eG9r7iAQmnOG62yFHeyUICalFY=";
|
||||||
url = "https://github.com/nextcloud/collectives/releases/download/v2.15.2/collectives-2.15.2.tar.gz";
|
url = "https://github.com/nextcloud/collectives/releases/download/v2.15.2/collectives-2.15.2.tar.gz";
|
||||||
|
|||||||
@@ -8,61 +8,72 @@ sops:
|
|||||||
- recipient: age1ljpdczmg5ctqyeezn739hv589fwhssjjnuqf7276fqun6kc62v3qmhkd0c
|
- recipient: age1ljpdczmg5ctqyeezn739hv589fwhssjjnuqf7276fqun6kc62v3qmhkd0c
|
||||||
enc: |
|
enc: |
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBqSk9GWktrZ3FsRHpOcTJp
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBmVGxsNmZ3Z0RIYmMyL0Mr
|
||||||
Y3VWMytTRlhxVXJma1puT1lMRTN2NHBNV2xrCi8xYTFWeVN6RWl0Um9mZXpoKzFh
|
UUpaMEZLTCtQaGFrL1YwOVBicEtNRTVaVGhRCmhDSUgxYXpRcldaMngvOWJDdnNo
|
||||||
SjVFcGJRNlhkVUZQYXpEb0EwYzUvUjQKLS0tIGEvdGdMRGxvcndxMllZTWZqKzg1
|
b2ZFbUdmcE9EV2E3SkMvZ1RpKzZmeU0KLS0tIE5hNmVFTXpBZFZ3bHYwQlJQaUtw
|
||||||
aWlJOTdYV1JMM0dIWEFDSHRuQWdlcVUKsdwGZ3SkJEf4ALDhHUlSQJNKrFyWd7fW
|
UFJmTVFaOTJXN09QLzY4emh5Z3hqRjAKXk1PSwR2x0H2cMN06fyigiusz8v2IRIg
|
||||||
WTGk66NJ2yD8ko/6OyB9J9U0WPbFLgr972H+klBq/IDmOx0hClbYNA==
|
S4ZTq/JX39U4QQHgWA1dFPfC636LNBo+QKdl/2mjwnXW7duqDJ+5kA==
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
- recipient: age1w07s4y2uh0xd322ralyyh79545lvxzqncd0s65q9cx4ttlqv5u9s7y78gr
|
|
||||||
enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoNzdib3Ztd0g0MlVqYVF6
|
|
||||||
cUtjZzEyY2FJYVRoT1p5RlJwYVQwUXVOUkNVCkp4V3hMYlJsaVN4RjlwQXNWS1Jt
|
|
||||||
aitzWVdOcUdrNHorenZGZU1iWFZzVjgKLS0tIGNGcTU5OUJLM3VzQk1uODFwS1hO
|
|
||||||
WG16Y25tMDkreGFnSFRKN1AybyttYWcKcLHJScp2Ozh0jIdi7Hb/tSjaCGorqXaC
|
|
||||||
9DIrQPHbPP1RIc6Ak8Kn30/BHEWV3VaiBCT3vfS9pNJQNjB4T+901g==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
-----END AGE ENCRYPTED FILE-----
|
||||||
lastmodified: "2024-11-26T20:00:50Z"
|
lastmodified: "2024-11-26T20:00:50Z"
|
||||||
mac: ENC[AES256_GCM,data:qoY9SfpoU+8HfvD5v/1S6BOkbnZUmHIbtwr0tTSuPETjnFNgr1VVw9mnRatJKPYYFb9/rMZQWIqTY+iUIEkcTVyVXhd6ki5CHW+uxCeBIyMzq33rtEa/btkEUoii4iPieamBCIY21W0znE+edxfR04yRJtLxMICEbuW4Hjf6bwk=,iv:nG42fRgjpuIjPMYnn/6egEdzYolcUBsspaZ8zMv4888=,tag:C6apGoAvVLsWdLWSCwrx6w==,type:str]
|
mac: ENC[AES256_GCM,data:qoY9SfpoU+8HfvD5v/1S6BOkbnZUmHIbtwr0tTSuPETjnFNgr1VVw9mnRatJKPYYFb9/rMZQWIqTY+iUIEkcTVyVXhd6ki5CHW+uxCeBIyMzq33rtEa/btkEUoii4iPieamBCIY21W0znE+edxfR04yRJtLxMICEbuW4Hjf6bwk=,iv:nG42fRgjpuIjPMYnn/6egEdzYolcUBsspaZ8zMv4888=,tag:C6apGoAvVLsWdLWSCwrx6w==,type:str]
|
||||||
pgp:
|
pgp:
|
||||||
- created_at: "2025-01-21T21:04:08Z"
|
- created_at: "2024-11-26T19:59:36Z"
|
||||||
enc: |-
|
enc: |-
|
||||||
-----BEGIN PGP MESSAGE-----
|
-----BEGIN PGP MESSAGE-----
|
||||||
|
|
||||||
hQGMA5HdvEwzh/H7AQv/ejIylIgs3yeVcZriQTA8d/xyXTdFw6On422lTCDk3d0W
|
hQGMA5HdvEwzh/H7AQv+KkX46UGQzLvhrk/VUCnnMdLEcNbYfk4h+sZJzs1riOGA
|
||||||
GOdV44vAzUzNX5tziQtLjectLUrKh9Qb9WaP4VnTCGI0XJ/dEtYRCkYMx8MjjbLl
|
LAKYNeaeN6iLLeZX+T2/s5OT4WkIEKGg8/gziurdx01BR70M96Faubp6EVtdK44+
|
||||||
8GqFi3Hw958Uykp9wt0iiP6BQ42Fo77EPxVcn21eHKZY0zg/vaeRXXeXSzkjzANs
|
6F5BLLrDhlEKDNOx48qPwJdFjbYW4wZLWmv5nzwPmmRCKO7MoI9UHKq69msCor1i
|
||||||
NN/KFS06uFRJhmp+0z6hDRrHnpb0wd5JGjHOp96jK9LmpwfZZZlVpAHp04hOhlPV
|
ralbjlVHyKSuRfvflKAlxFoEqeB6H+ryc54g3stk1j2eFiMNuF/oKDJZT+XI5LHZ
|
||||||
cMmdjg9IRSubvbraTbDrgwB0h3JKdqovFDnAP/KvT+rw5xnVUVMq/3tUNq4MbfZb
|
Ai80DAWoUBYgpP4aWiNC075GPutdPlZ3mrGf5+7QnNm7GmNUdJN5VAWmI2NUGr1J
|
||||||
CvQrXsjQJQbEhY+eAJZVRO07kX0+zMvIin4ss7Xt++qlo4/OvFvuGbnUhJE+hrBb
|
BLopnPFo4juWNsZkLMj2aAuKvGTkhz2PuFKfLj6Erpu82RAjadpFWx239n+i4Ryq
|
||||||
nkyGhbDrjpsfa3djCEZ0UxMAWtPeIQ7T8QMkGY+UKeJKxfOGSchARnfCtGD/rtsj
|
wSquYshpuiecLEejntTBKLEacwp+aPx8IHKnOOKBTdJj+YYaISiznQAlkF7WS+lg
|
||||||
wuhqGya7g7WP78WzwASzlPwB5jpdQ29/zLWXR60lNCYu0UYSVYmlspZnKEB0FkLO
|
MTZR85BvCxiPogujL7uhYSx1wM5FVkuAIPf1JOJCRvQt30eRRrR0VMrmqQ1Kl5OT
|
||||||
TNUrwXXMrM0XwMVaG/sF0lgBEPE6CTuE85evCHFyu6zhEAa7YimKAPIowcwYLSJ2
|
VMzZRIGIoC5vrKGeIIjJ0lgBWQ3bYFh/LGrwKetku6TRAH29mp/XwQqBC97RsUYb
|
||||||
46KfttJAYnRnb68Kk9N5xcFyvhKyTx/6eMdxkgr2LMoSTBDUgZfG3rDQC+ZbFE3m
|
EOxft5sUWaYrXK+z2yzCxOQBWKJISPgcyhdoKfYGnRkHXHi2Uay84oQP4co72eVF
|
||||||
bUOvx3Ho80EC
|
cAhEJOxMw36e
|
||||||
=oQd6
|
=bSaN
|
||||||
-----END PGP MESSAGE-----
|
-----END PGP MESSAGE-----
|
||||||
fp: c4639370c41133a738f643a591ddbc4c3387f1fb
|
fp: c4639370c41133a738f643a591ddbc4c3387f1fb
|
||||||
- created_at: "2025-01-21T21:04:08Z"
|
- created_at: "2024-11-26T19:59:36Z"
|
||||||
enc: |-
|
enc: |-
|
||||||
-----BEGIN PGP MESSAGE-----
|
-----BEGIN PGP MESSAGE-----
|
||||||
|
|
||||||
hQIMA98TrrsQEbXUAQ//eu7YkPL7dU4AYWCZI7THsiJ51SOMahOXp/qC5yL18aZY
|
hQIMA98TrrsQEbXUARAAmG88ZDt43zj6dCJkYYVj7MGIhIviJzilTvX4+EfNobtA
|
||||||
r4SpyNhFezGIJfMuhwBSZZBI/MNW6M+zMwIJ2wkioxUDnDvfVi10/cV6p85U75Jn
|
tll60GYfRotKnwbuqzSVaaIcV+6cDQ5I1hG5WNFJSXm7DpJ0W1Ir1x2hpxektXFa
|
||||||
59e1afN+eekG2DCI6sWPmLy8jmYh4CQRdEurtfzquDOARZ4IHZjotP5AWI8OPHlM
|
fQ+9HiCOfEqUu5PEynCAD1jN6CQLdl87hLQx9TqbZnHuUYPSH1o9Y6kbA/Vp3bpy
|
||||||
FdK2jGXFVevQY0m619CNm78D2NEdlGe1QtLVSazWQ8MsDLfMnHTYFUy3EoSihzat
|
evJc8qa66WHYH1kjdEw+qneD5HzZQOLOtXZ7xkxjGbyMcYex9JfyGHohO5dpLg6B
|
||||||
QkcR//8whzlLT/NcqKlnBDNBU7FvPov+ZdUmIw1mx2wp5f2sGp4m737Yhoey2aFL
|
3XrLlIWWERVz04MlnzlaMKfzhoMCU9ByqJSQ3VBm9kblQqu54fOZD2sN8j9ACEfL
|
||||||
qLXHDc91nVRcw95FBDNYlSH8a2AzT4sm4vFR5EkC6vrfz+v1pdg1Fc3dc++hPgE0
|
YNC7Jm2rasVSqv09G1kso9/VNDw3kNCLvjnpE5rJRP7Ckfj+4FxQN/zPVUwQ1e1k
|
||||||
MYWn6f4v8lDhPhw2kpmAP4Oz4uPdmPgdfXKiIzr7qf3O5lIC6ZIIwoqhj2f0odj6
|
upoQ8MHyf1bJr8vspm/prm9zp+PRRTUwY1Yyts/ffj+CF5ec9M3jr/RSeEAdswsL
|
||||||
7anDUN5C3B5ruFU3UNJEBLrZelbmg4zf2hAtzfoi0L9paIZX5SCLP3PDbvdRbADc
|
6dLKBL1LuLAjKXOuVnQ7E6gN940Y994sDFkbqEmzzCUHGcfxSF3IDn/qpkQlqerU
|
||||||
oyC3Gw/DeddQ9ZeP+wYiwJ/614zRBmZRzQr9RFowf0gJBSS7TaWPCONfUJ/3eekX
|
B/D43Yef+rtsUDyTA5RUpxKleGORcS4sV0BhQrNXeFclaMTyMr+AbOei4Y77qlD1
|
||||||
or8JpLTD5PMQNoS0L4S41Cj+yOg/AlmHF/9yvj1GVTKT9rBj3Snki9NOmY2ZUQo3
|
x/fHB3IT4Intvp9k4m6jJ86RtLpVhEoA4cHEdCCiXHzUpA6aVtNHVAOqT/aBykrf
|
||||||
BDdnsftA3w4q4iu06ojQkrjn/FJjmNzb83XR2WxrHFUAaY//nISyY/9uTsEhwFbS
|
uSm1wu/nl6yKbIwTJueli1OfQYKEYcUdjOrEOwXb+UDQKSohWZrMg0sj7/S6Pl/S
|
||||||
WAFlKfmyVc7nLBI12i0yWLLy/tcVF3c8gtGfNmyoe/RIr+6EQmzUi0v+X49Tnzpj
|
WAG1BZ20HXD2ZrVqESV87Pl04nKMqswrio+BINfAT9X3ya7L3DF69MR18bDt+ZIB
|
||||||
8JAnE+4Jzm2ijqF4Ats5KoXqFiLUenJZQHJ3IFoI36n+hM4P/ICeZ4k=
|
0F3+9WUREGI5in4S3hXNxrgfLNFl1YLklfWLYcx0HXJN3z6F2eJOUvM=
|
||||||
=s9pl
|
=aT3U
|
||||||
-----END PGP MESSAGE-----
|
-----END PGP MESSAGE-----
|
||||||
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
|
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
|
||||||
|
- created_at: "2024-11-26T19:59:36Z"
|
||||||
|
enc: |-
|
||||||
|
-----BEGIN PGP MESSAGE-----
|
||||||
|
|
||||||
|
hQIMA1kR3vWkIYVnARAAqFyuCtvu6AidWg/9+btEcjWv0sBZaIRpYfX3p2QECwCu
|
||||||
|
UYAtssvSHgHdBEQzU27MA/5CGmEreB3NhWrjGquv88RojLO1JuhNHGYPZKeIcBKr
|
||||||
|
I2oS79RKuYs+d2Qu0KUYDaVoY9M5YJsfkju2FOXqMNYlbqX+lDuWnisigj3n2N4e
|
||||||
|
OEBnVIpfPBQE6c1Z9DaQJE7MyBbKfg5YeWjlwwh+fCf1dV/nGp+QdD88F3dzWMoK
|
||||||
|
xNGt69TwZ8JUVmElAIJqLJTpyDI5xHQUw2A6ddPSTk/u363eHhOnZZUNAAm3FdO5
|
||||||
|
0x+4QhcBaH59S8WDZhw4MVmZN7v4+3l3mf7Rx/TXSz4oJg+U7RMgvc291/gowNVm
|
||||||
|
/cVhBlMYz4Ogx/OYR/t+nzq35r+eBungTB+dRXw7qTTfkCtNgp34JMCkGAq5WWnY
|
||||||
|
57H2HtssGiMF0qN4SfWxw7317oUmqHI2XvG0yWt42G++jNgIGbDOtuc/7wATEbhK
|
||||||
|
SBX2aLqDIB1OUwLHQeawyKkB0qGmRSVPkPg8JLwRp43ICETH1WPkY5m/a2slVlDj
|
||||||
|
qgdw00clTI5Fgu/5G5QBD4Ds9f9ZwjrMD4v+NYfGxa0ajisXl1X6CL1+YvQ6Uicf
|
||||||
|
QmIRJYxyVd0VoXScZnsk0T/XTKjJB/fRLRalA2PmlZ1v+gisCUz2dhM+OHtSjGTS
|
||||||
|
WAG5znRbP8UMVt02O0PgbzHYtIUAtQLCuBnzfEKJn721rqCXf7DXU3jrR73Ys6ce
|
||||||
|
VJzkVBMnBszF71GN56t0PaUYIDOnaGvgjMtHHtOCLQHSK7asnm/Bc+E=
|
||||||
|
=Znii
|
||||||
|
-----END PGP MESSAGE-----
|
||||||
|
fp: 4095412245b6efc14cf92ca25911def5a4218567
|
||||||
unencrypted_suffix: _unencrypted
|
unencrypted_suffix: _unencrypted
|
||||||
version: 3.8.1
|
version: 3.8.1
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{ config, self, lib, pkgs, inputs, ... }:
|
{ config, lib, pkgs, inputs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
@@ -9,27 +9,17 @@ with lib;
|
|||||||
};
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
self.nixosModules.malobeo.metrics
|
|
||||||
../modules/malobeo_user.nix
|
../modules/malobeo_user.nix
|
||||||
../modules/sshd.nix
|
../modules/sshd.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 80 3100 ];
|
networking.firewall.allowedTCPPorts = [ 80 9080 9001 3100 ];
|
||||||
|
|
||||||
malobeo.metrics = {
|
|
||||||
enable = true;
|
|
||||||
enablePromtail = true;
|
|
||||||
logNginx = false;
|
|
||||||
lokiHost = "10.0.0.14";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.grafana = {
|
services.grafana = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.server = {
|
domain = "grafana.malobeo.org";
|
||||||
domain = "grafana.malobeo.org";
|
port = 2342;
|
||||||
http_port = 2342;
|
addr = "127.0.0.1";
|
||||||
http_addr = "127.0.0.1";
|
|
||||||
};
|
|
||||||
|
|
||||||
provision.datasources.settings = {
|
provision.datasources.settings = {
|
||||||
apiVersion = 1;
|
apiVersion = 1;
|
||||||
@@ -107,12 +97,6 @@ with lib;
|
|||||||
targets = [ "10.0.0.13:9002" ];
|
targets = [ "10.0.0.13:9002" ];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
{
|
|
||||||
job_name = "fanny";
|
|
||||||
static_configs = [{
|
|
||||||
targets = [ "10.0.0.1:9002" ];
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
# add vpn - check how to reach it first. most probably 10.100.0.1
|
# add vpn - check how to reach it first. most probably 10.100.0.1
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ auth_enabled: false
|
|||||||
server:
|
server:
|
||||||
http_listen_port: 3100
|
http_listen_port: 3100
|
||||||
grpc_listen_port: 9096
|
grpc_listen_port: 9096
|
||||||
log_level: info
|
log_level: debug
|
||||||
grpc_server_max_concurrent_streams: 1000
|
grpc_server_max_concurrent_streams: 1000
|
||||||
|
|
||||||
common:
|
common:
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
grafana_admin: ENC[AES256_GCM,data:c+ZnOyxSXrG4eiK8ETKHheadiSz98LLHYwxb,iv:Ut2qFD2p6OmKDWjLMjFxyISxzTdJpZpgIB7obW5bgkY=,tag:HdayzjXQ1Zc7w9ITLzKLxA==,type:str]
|
|
||||||
sops:
|
|
||||||
kms: []
|
|
||||||
gcp_kms: []
|
|
||||||
azure_kv: []
|
|
||||||
hc_vault: []
|
|
||||||
age:
|
|
||||||
- recipient: age1ljpdczmg5ctqyeezn739hv589fwhssjjnuqf7276fqun6kc62v3qmhkd0c
|
|
||||||
enc: |
|
|
||||||
-----BEGIN AGE ENCRYPTED FILE-----
|
|
||||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxN1VURXJuMENJV1Z2eEtS
|
|
||||||
bUR2cTNmNUdhU1B4SHZNMW9KRDV2dW5VNmlNCjdmYXpZb05mMEdPdjN4c0VWOUhV
|
|
||||||
RW4vV05CMno1MmJmYzdESjN5MFVFcjQKLS0tIDNxTE1KaW1EVGhtOEQwWXZndk53
|
|
||||||
bFBCMExGdEdMb2Z0TzF0Yk02MUpkN0kKIUm9iUvU/xu1Xl6yoYSVGcIXKnGsp/D/
|
|
||||||
RjVQ7tgJIbrupubny/fg4v2sz5HOs5uzmEq4ZKgBWrBeMPss4gYstA==
|
|
||||||
-----END AGE ENCRYPTED FILE-----
|
|
||||||
lastmodified: "2025-01-22T00:51:32Z"
|
|
||||||
mac: ENC[AES256_GCM,data:TEEyPmVxIJxC49hDqDbwzTZZ/tNymFr0dMvWn6DRli70Kp5XXNCLTpicAbiFh3WoyzbDpN/5c2yxVNGjhB8nXgKpCZdffdONMY6eSCpPbblYwJS7hNsjW+u2wysSFPDAk5apwbNXJcKnlI1tBcGQRHlym9ShSw6fT7K7afWYWqo=,iv:583DWNug8yNF/vZZN4btT6P1yUa0b1UN4frvAX4UKv0=,tag:YI5KIAe5P5Bx0TZU4wG8ag==,type:str]
|
|
||||||
pgp:
|
|
||||||
- created_at: "2025-01-22T00:51:09Z"
|
|
||||||
enc: |-
|
|
||||||
-----BEGIN PGP MESSAGE-----
|
|
||||||
|
|
||||||
hQGMA5HdvEwzh/H7AQv+PxajhJgXHcxwJ7Mk0gjqFV0dGmNJ1m0eY3gPyIS38GSB
|
|
||||||
Rjto1zUd6EARu1GnxSrVrSZYlQaL6x3l2DuFIP7mtymvlFrmhiAoDz/si0zlzsJp
|
|
||||||
WZyQZdepnt9FyYJAwTzbmfVdpZDYajuMI38byMJqzUhS7SEOsPwiU1KRoTHcf4se
|
|
||||||
2E+9v8OwTVT2UoDxyiVJuDAA+K+Jh2RjHk3p/uVnZDqqQpI9UAI8LrCpun9uALpH
|
|
||||||
+29wyhkCZ9RIHU7nDQNVvwHkbYCyRUwR44bciSwITpjp7GuZCcZvzSSimPktkC9q
|
|
||||||
VZkHA6rHgHgcu6mnMfpP0+j4gB0dU0t4hGF41klV3YpEGfYcFIsKV10lfa6aMNmW
|
|
||||||
08RuLdCtnQyplYhgBm1zQvYHJsIuwK9s1B2dz3Z8l3o2eg8AqFuIL+MlZOvf5A/2
|
|
||||||
MOXffyXbOM5Dhy7DdUckTOYYfwWe1mStw3vx3I3mAFzuOOR7HQuzlc9Bf1oxh36T
|
|
||||||
6e/qOijjPPqkLeR2mufo0lgBBFTQFt2jVvMo1lrCB8Amj4yj/4noXTzglkYTYBKs
|
|
||||||
S513kUdhAGtWoNrqcItOYAn/gl+CPGY2Op3tJBVCWM6aT/KO6M/LPJ7wiQk2zlOL
|
|
||||||
pp7SnCKvv9eQ
|
|
||||||
=N+uj
|
|
||||||
-----END PGP MESSAGE-----
|
|
||||||
fp: c4639370c41133a738f643a591ddbc4c3387f1fb
|
|
||||||
- created_at: "2025-01-22T00:51:09Z"
|
|
||||||
enc: |-
|
|
||||||
-----BEGIN PGP MESSAGE-----
|
|
||||||
|
|
||||||
hQIMA98TrrsQEbXUAQ//fm/TcxgsAMY6P8jvOQMcRBmjjVwfLP1UTTnkRUa36Mmn
|
|
||||||
2V9619zsH1dzTp0gUVV8mvIKUtpz2nCBTZBJw803wW9KorxW6f4e3+mIWelZT5WM
|
|
||||||
sLcQPFWAYKDVnSfk5j8kRSmpM6k2xFRB9DTEMIyFH9PZL99Fztp2hjTn553YTQOo
|
|
||||||
pdw+AMzgptYQghW/Pl/32wXHwCO+bL8tyk62VIQO13l3tX83oSslXNkFzNQYt3jv
|
|
||||||
xXFUaQEGD/1lFLeFnIuJZzfjWt6n0fShJboUcuk/ZIcYdwrbG0pyLLoBoObSRQtG
|
|
||||||
t+7VpWpfl3rnk822SU9z9YcaMNy9HD3Kz9Qh0BRQiN3scCMzm1LyzlXLqlc/gPiq
|
|
||||||
JyCxy98vJXIxmlLQZpDFfTMe3xsc8jSsHI6av+wEFKGEJAOUkDtRYvLfZdgDTfiB
|
|
||||||
XTAhQ3ixnlBxdZZ9DjBXyVfM8q9iB8bggFi7g2SjO32LKhXRFUqZR+avddCyKR/V
|
|
||||||
hRpWjDRn+eX2tl7LPawvX6tIow3aZiezkMVyeRXfcZCvpicq64b80LrYR+JJUfJE
|
|
||||||
vxHaekKImrdJ9ocii0wW91ZmESJwL6m5lt3ZsCY5GTlEDt4wBse5uhj48mtuK8sh
|
|
||||||
g8uQMKp7SiiCtV5a6O1SQLDJeAt6VCcRyudLToO9S4gwrGXNPcGxsHj07XAN2PHS
|
|
||||||
WAE6wUhufXfpa8UgSWy7fmEZt4L03XlRfC7bm/ycwaFww3A7w4+B1gkW6gOon6sy
|
|
||||||
nOyIxUZfU6abZWKzH+OIuViKH7xPiULDy75gEmkRHjKu5BiC3Tx0eO4=
|
|
||||||
=+PPr
|
|
||||||
-----END PGP MESSAGE-----
|
|
||||||
fp: aef8d6c7e4761fc297cda833df13aebb1011b5d4
|
|
||||||
unencrypted_suffix: _unencrypted
|
|
||||||
version: 3.9.2
|
|
||||||
@@ -24,7 +24,7 @@ in
|
|||||||
|
|
||||||
malobeo.disks = {
|
malobeo.disks = {
|
||||||
enable = true;
|
enable = true;
|
||||||
encryption = true;
|
encryption = false;
|
||||||
hostId = "83abc8cb";
|
hostId = "83abc8cb";
|
||||||
devNodes = "/dev/disk/by-path/";
|
devNodes = "/dev/disk/by-path/";
|
||||||
root = {
|
root = {
|
||||||
@@ -35,36 +35,9 @@ with lib;
|
|||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://10.100.0.101";
|
proxyPass = "http://10.100.0.101";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header Host $host;
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
virtualHosts."cloud.malobeo.org" = {
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://10.100.0.101";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualHosts."grafana.malobeo.org" = {
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://10.100.0.101";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualHosts."tasklist.malobeo.org" = {
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://10.100.0.101";
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
309
outputs.nix
309
outputs.nix
@@ -12,11 +12,241 @@
|
|||||||
let filter_system = name: if name == utils.lib.system.i686-linux then false else true;
|
let filter_system = name: if name == utils.lib.system.i686-linux then false else true;
|
||||||
in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems) ( system:
|
in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems) ( system:
|
||||||
let
|
let
|
||||||
|
baseModules = [
|
||||||
|
# make flake inputs accessiable in NixOS
|
||||||
|
{ _module.args.inputs = inputs; }
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
({ pkgs, ... }: {
|
||||||
|
nix = {
|
||||||
|
extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
'';
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
substituters = [
|
||||||
|
"https://cache.dynamicdiscord.de"
|
||||||
|
"https://cache.nixos.org/"
|
||||||
|
];
|
||||||
|
trusted-public-keys = [
|
||||||
|
"cache.dynamicdiscord.de:DKueZicqi2NhJJXz9MYgUbiyobMs10fTyHCgAUibRP4="
|
||||||
|
];
|
||||||
|
trusted-users = [ "root" "@wheel" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
sops-nix.nixosModules.sops
|
||||||
|
#microvm.nixosModules.microvm
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
defaultModules = baseModules;
|
||||||
|
|
||||||
|
makeMicroVM = hostName: ipv4Addr: macAddr: modules: [
|
||||||
|
self.nixosModules.malobeo.metrics
|
||||||
|
{
|
||||||
|
microvm = {
|
||||||
|
hypervisor = "cloud-hypervisor";
|
||||||
|
mem = 2560;
|
||||||
|
shares = [
|
||||||
|
{
|
||||||
|
source = "/nix/store";
|
||||||
|
mountPoint = "/nix/.ro-store";
|
||||||
|
tag = "store";
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "store.socket";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source = "/var/lib/microvms/${hostName}/etc";
|
||||||
|
mountPoint = "/etc";
|
||||||
|
tag = "etc";
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "etc.socket";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source = "/var/lib/microvms/${hostName}/var";
|
||||||
|
mountPoint = "/var";
|
||||||
|
tag = "var";
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "var.socket";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
interfaces = [
|
||||||
|
{
|
||||||
|
type = "tap";
|
||||||
|
id = "vm-${hostName}";
|
||||||
|
mac = "${macAddr}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
malobeo.metrics = {
|
||||||
|
enable = true;
|
||||||
|
enablePromtail = true;
|
||||||
|
logNginx = false;
|
||||||
|
lokiHost = "10.0.0.14";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.network.enable = true;
|
||||||
|
|
||||||
|
systemd.network.networks."20-lan" = {
|
||||||
|
matchConfig.Type = "ether";
|
||||||
|
networkConfig = {
|
||||||
|
Address = [ "${ipv4Addr}/24" ];
|
||||||
|
Gateway = "10.0.0.1";
|
||||||
|
DNS = ["1.1.1.1"];
|
||||||
|
DHCP = "no";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
] ++ defaultModules ++ modules;
|
||||||
|
|
||||||
|
|
||||||
pkgs-unstable = nixpkgs-unstable.legacyPackages."${system}";
|
pkgs-unstable = nixpkgs-unstable.legacyPackages."${system}";
|
||||||
pkgs = nixpkgs.legacyPackages."${system}";
|
pkgs = nixpkgs.legacyPackages."${system}";
|
||||||
|
|
||||||
hosts = import ./machines/hosts.nix ( inputs // { inherit inputs; self = self; });
|
vmMicroVMOverwrites = hostname: options: {
|
||||||
utils = import ./machines/modules/host_builder.nix ( inputs // { inherit inputs; self = self; hosts = hosts; });
|
microvm = {
|
||||||
|
mem = pkgs.lib.mkForce 4096;
|
||||||
|
hypervisor = pkgs.lib.mkForce "qemu";
|
||||||
|
socket = pkgs.lib.mkForce null;
|
||||||
|
|
||||||
|
|
||||||
|
#needed for hosts that deploy imperative microvms (for example fanny)
|
||||||
|
writableStoreOverlay = pkgs.lib.mkIf options.writableStore "/nix/.rw-store";
|
||||||
|
volumes = pkgs.lib.mkIf options.writableStore [ {
|
||||||
|
image = "nix-store-overlay.img";
|
||||||
|
mountPoint = self.nixosConfigurations.${hostname}.config.microvm.writableStoreOverlay;
|
||||||
|
size = 2048;
|
||||||
|
} ];
|
||||||
|
|
||||||
|
shares = pkgs.lib.mkForce (pkgs.lib.optionals (!options.writableStore) [
|
||||||
|
{
|
||||||
|
tag = "ro-store";
|
||||||
|
source = "/nix/store";
|
||||||
|
mountPoint = "/nix/.ro-store";
|
||||||
|
}
|
||||||
|
] ++ pkgs.lib.optionals (options.varPath != "") [
|
||||||
|
{
|
||||||
|
source = "${options.varPath}";
|
||||||
|
securityModel = "mapped";
|
||||||
|
mountPoint = "/var";
|
||||||
|
tag = "var";
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
interfaces = pkgs.lib.mkIf (!options.withNetworking) (pkgs.lib.mkForce [{
|
||||||
|
type = "user";
|
||||||
|
id = "eth0";
|
||||||
|
mac = "02:23:de:ad:be:ef";
|
||||||
|
}]);
|
||||||
|
|
||||||
|
#if networking is disabled forward port 80 to still have access to webservices
|
||||||
|
forwardPorts = pkgs.lib.mkIf (!options.withNetworking) (pkgs.lib.mkForce [
|
||||||
|
{ from = "host"; host.port = 8080; guest.port = 80; }
|
||||||
|
]);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems = {
|
||||||
|
"/".fsType = pkgs.lib.mkForce "tmpfs";
|
||||||
|
|
||||||
|
# prometheus uses a memory mapped file which doesnt seem supported by 9p shares
|
||||||
|
# therefore we mount a tmpfs inside the datadir
|
||||||
|
"/var/lib/prometheus2/data" = pkgs.lib.mkIf (hostname == "overwatch" && options.varPath != "") (pkgs.lib.mkForce {
|
||||||
|
fsType = pkgs.lib.mkForce "tmpfs";
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.isContainer = pkgs.lib.mkForce false;
|
||||||
|
services.timesyncd.enable = false;
|
||||||
|
users.users.root.password = "";
|
||||||
|
services.getty.helpLine = ''
|
||||||
|
Log in as "root" with an empty password.
|
||||||
|
Use "reboot" to shut qemu down.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
vmDiskoOverwrites = {
|
||||||
|
boot.initrd = {
|
||||||
|
secrets = pkgs.lib.mkForce {};
|
||||||
|
network.ssh.enable = pkgs.lib.mkForce false;
|
||||||
|
};
|
||||||
|
|
||||||
|
malobeo.disks.enable = pkgs.lib.mkForce false;
|
||||||
|
networking.hostId = "a3c3101f";
|
||||||
|
};
|
||||||
|
|
||||||
|
vmSopsOverwrites = host: {
|
||||||
|
sops.defaultSopsFile = pkgs.lib.mkForce ./machines/${host}/dummy.yaml;
|
||||||
|
|
||||||
|
environment.etc = {
|
||||||
|
devHostKey = {
|
||||||
|
source = ./machines/secrets/devkey_ed25519;
|
||||||
|
mode = "0600";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.openssh.hostKeys = [{
|
||||||
|
path = "/etc/devHostKey";
|
||||||
|
type = "ed25519";
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
buildVM = host: networking: sopsDummy: disableDisko: varPath: writableStore: (self.nixosConfigurations.${host}.extendModules {
|
||||||
|
modules = [
|
||||||
|
(vmMicroVMOverwrites host {
|
||||||
|
withNetworking = networking;
|
||||||
|
varPath = "${varPath}";
|
||||||
|
writableStore = writableStore; })
|
||||||
|
(if sopsDummy then (vmSopsOverwrites host) else {})
|
||||||
|
(if disableDisko then vmDiskoOverwrites else {})
|
||||||
|
] ++ pkgs.lib.optionals (! self.nixosConfigurations.${host}.config ? microvm) [
|
||||||
|
#microvm.nixosModules.microvm
|
||||||
|
] ++ pkgs.lib.optionals (self.nixosConfigurations.${host}.config ? services.malobeo.microvm.deployHosts) [
|
||||||
|
#microvm.nixosModules.host
|
||||||
|
{
|
||||||
|
services.malobeo.microvm.deployHosts = pkgs.lib.mkForce [];
|
||||||
|
systemd.tmpfiles.rules = builtins.concatLists (map (name: [
|
||||||
|
"q /var/lib/microvms/${name}/var 0755 root root - -"
|
||||||
|
"q /var/lib/microvms/${name}/etc 0755 root root - -"
|
||||||
|
"q /var/${name}/wow/it/works 0755 root root - -"
|
||||||
|
"q /var/lib/${name} 0755 root root - -"
|
||||||
|
"d /${name} 0755 root root - -"
|
||||||
|
]) self.nixosConfigurations.${host}.config.services.malobeo.microvm.deployHosts);
|
||||||
|
|
||||||
|
|
||||||
|
microvm.vms =
|
||||||
|
let
|
||||||
|
# Map the values to each hostname to then generate an Attrset using listToAttrs
|
||||||
|
mapperFunc = name: { inherit name; value = {
|
||||||
|
#pkgs = import self.nixosConfigurations.${name}.config.nixpkgs;
|
||||||
|
|
||||||
|
#pkgs = (buildVM name networking sopsDummy false "" false).config.nixpkgs;
|
||||||
|
#config = (buildVM name networking sopsDummy false "" false);
|
||||||
|
#pkgs = pkgs;
|
||||||
|
#config = self.nixosConfigurations.${name};
|
||||||
|
specialArgs.inputs = inputs;
|
||||||
|
specialArgs.self = self;
|
||||||
|
config = {
|
||||||
|
imports = (makeMicroVM "${name}" "10.0.0.11" "D0:E5:CA:F0:D7:E7" [
|
||||||
|
|
||||||
|
#(vmMicroVMOverwrites name {
|
||||||
|
# withNetworking = true;
|
||||||
|
# varPath = "";
|
||||||
|
# writableStore = false; })
|
||||||
|
(if sopsDummy then (vmSopsOverwrites name) else {})
|
||||||
|
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
};
|
||||||
|
}; };
|
||||||
|
in
|
||||||
|
builtins.listToAttrs (map mapperFunc self.nixosConfigurations.${host}.config.services.malobeo.microvm.deployHosts);
|
||||||
|
}];
|
||||||
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
devShells.default =
|
devShells.default =
|
||||||
@@ -52,7 +282,7 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
|||||||
scripts.run-vm = self.packages.${system}.run-vm;
|
scripts.run-vm = self.packages.${system}.run-vm;
|
||||||
};
|
};
|
||||||
|
|
||||||
vmBuilder = utils.buildVM;
|
vmBuilder = buildVM;
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
docs = pkgs.stdenv.mkDerivation {
|
docs = pkgs.stdenv.mkDerivation {
|
||||||
@@ -72,7 +302,64 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
run-vm = pkgs.writeShellScriptBin "run-vm" (builtins.readFile ./scripts/run-vm.sh);
|
run-vm = pkgs.writeShellScriptBin "run-vm" ''
|
||||||
|
usage() {
|
||||||
|
echo "Usage: run-vm <hostname> [--networking] [--dummy-secrets] [--no-disko]"
|
||||||
|
echo "ATTENTION: This script must be run from the flakes root directory"
|
||||||
|
echo "--networking setup interfaces. requires root and hostbridge enabled on the host"
|
||||||
|
echo "--dummy-secrets run vm with dummy sops secrets"
|
||||||
|
echo "--no-disko disable disko and initrd secrets. needed for real hosts like fanny"
|
||||||
|
echo "--writable-store enables writable store. necessary for host with nested imperative microvms like fanny"
|
||||||
|
echo "--var path to directory that should be shared as /var. may require root otherwise some systemd units fail within vm. if dir is empty vm will populate"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# check at least one arg was given
|
||||||
|
if [ "$#" -lt 1 ]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
HOSTNAME=$1
|
||||||
|
|
||||||
|
# Optionale Argumente
|
||||||
|
NETWORK=false
|
||||||
|
DUMMY_SECRETS=false
|
||||||
|
NO_DISKO=false
|
||||||
|
RW_STORE=false
|
||||||
|
VAR_PATH=""
|
||||||
|
|
||||||
|
# check argws
|
||||||
|
shift
|
||||||
|
while [[ "$#" -gt 0 ]]; do
|
||||||
|
case $1 in
|
||||||
|
--networking) NETWORK=true ;;
|
||||||
|
--dummy-secrets) DUMMY_SECRETS=true ;;
|
||||||
|
--no-disko) NO_DISKO=true ;;
|
||||||
|
--writable-store) RW_STORE=true ;;
|
||||||
|
--var)
|
||||||
|
if [[ -n "$2" && ! "$2" =~ ^- ]]; then
|
||||||
|
VAR_PATH="$2"
|
||||||
|
shift
|
||||||
|
else
|
||||||
|
echo "Error: --var requires a non-empty string argument."
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*) echo "Unknown argument: $1"; usage ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
echo "starting host $HOSTNAME"
|
||||||
|
echo "enable networking: $NETWORK"
|
||||||
|
echo "deploy dummy secrets: $DUMMY_SECRETS"
|
||||||
|
echo "disable disko and initrd secrets: $NO_DISKO"
|
||||||
|
echo "use writable store: $RW_STORE"
|
||||||
|
if [ -n "$VAR_PATH" ]; then
|
||||||
|
echo "sharing var directory: $VAR_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
${pkgs.nix}/bin/nix run --show-trace --impure --expr "((builtins.getFlake \"$(pwd)\").vmBuilder.x86_64-linux \"$HOSTNAME\" $NETWORK $DUMMY_SECRETS $NO_DISKO \"$VAR_PATH\" $RW_STORE).config.microvm.declaredRunner"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
apps = {
|
apps = {
|
||||||
@@ -98,13 +385,11 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
})) // (
|
})) // {
|
||||||
let
|
nixosConfigurations = import ./machines/configuration.nix (inputs // {
|
||||||
hosts = import ./machines/hosts.nix ( inputs // { inherit inputs; self = self; });
|
inherit inputs;
|
||||||
utils = import ./machines/modules/host_builder.nix ( inputs // { inherit inputs; self = self; hosts = hosts; });
|
self = self;
|
||||||
in
|
});
|
||||||
{
|
|
||||||
nixosConfigurations = utils.buildHost hosts.malobeo.hosts;
|
|
||||||
|
|
||||||
nixosModules.malobeo = {
|
nixosModules.malobeo = {
|
||||||
host.imports = [ ./machines/durruti/host_config.nix ];
|
host.imports = [ ./machines/durruti/host_config.nix ];
|
||||||
@@ -126,4 +411,4 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
|
|||||||
nixpkgs.lib.mapAttrs getBuildEntry self.nixosConfigurations
|
nixpkgs.lib.mapAttrs getBuildEntry self.nixosConfigurations
|
||||||
|
|
||||||
);
|
);
|
||||||
})
|
}
|
||||||
|
|||||||
@@ -37,11 +37,9 @@ trap cleanup EXIT
|
|||||||
|
|
||||||
# Create the directory where sshd expects to find the host keys
|
# Create the directory where sshd expects to find the host keys
|
||||||
install -d -m755 "$temp/etc/ssh/"
|
install -d -m755 "$temp/etc/ssh/"
|
||||||
install -d -m755 "$temp/root/"
|
|
||||||
|
|
||||||
diskKey=$(sops -d machines/$hostname/disk.key)
|
diskKey=$(sops -d machines/$hostname/disk.key)
|
||||||
echo "$diskKey" > /tmp/secret.key
|
echo "$diskKey" > /tmp/secret.key
|
||||||
echo "$diskKey" > $temp/root/secret.key
|
|
||||||
|
|
||||||
ssh-keygen -f $temp/etc/ssh/"$hostname" -t ed25519 -N ""
|
ssh-keygen -f $temp/etc/ssh/"$hostname" -t ed25519 -N ""
|
||||||
ssh-keygen -f $temp/etc/ssh/initrd -t ed25519 -N ""
|
ssh-keygen -f $temp/etc/ssh/initrd -t ed25519 -N ""
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
usage() {
|
|
||||||
echo "Usage: run-vm <hostname> [--networking] [--dummy-secrets] [--no-disko]"
|
|
||||||
echo "ATTENTION: This script must be run from the flakes root directory"
|
|
||||||
echo "--networking setup interfaces. requires root and hostbridge enabled on the host"
|
|
||||||
echo "--dummy-secrets run vm with dummy sops secrets"
|
|
||||||
echo "--no-disko disable disko and initrd secrets. needed for real hosts like fanny"
|
|
||||||
echo "--writable-store enables writable store. necessary for host with nested imperative microvms like fanny"
|
|
||||||
echo "--var path to directory that should be shared as /var. may require root otherwise some systemd units fail within vm. if dir is empty vm will populate"
|
|
||||||
echo "--fwd-port forwards the given port to port 80 on vm"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# check at least one arg was given
|
|
||||||
if [ "$#" -lt 1 ]; then
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
|
|
||||||
HOSTNAME=$1
|
|
||||||
|
|
||||||
# Optionale Argumente
|
|
||||||
NETWORK=false
|
|
||||||
DUMMY_SECRETS=false
|
|
||||||
NO_DISKO=false
|
|
||||||
RW_STORE=false
|
|
||||||
VAR_PATH=""
|
|
||||||
FWD_PORT=0
|
|
||||||
|
|
||||||
# check argws
|
|
||||||
shift
|
|
||||||
while [[ "$#" -gt 0 ]]; do
|
|
||||||
case $1 in
|
|
||||||
--networking) NETWORK=true ;;
|
|
||||||
--dummy-secrets) DUMMY_SECRETS=true ;;
|
|
||||||
--no-disko) NO_DISKO=true ;;
|
|
||||||
--writable-store) RW_STORE=true ;;
|
|
||||||
--var)
|
|
||||||
if [[ -n "$2" && ! "$2" =~ ^- ]]; then
|
|
||||||
VAR_PATH="$2"
|
|
||||||
shift
|
|
||||||
else
|
|
||||||
echo "Error: --var requires a non-empty string argument."
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
--fwd-port)
|
|
||||||
if [[ -n "$2" && ! "$2" =~ ^- ]]; then
|
|
||||||
FWD_PORT="$2"
|
|
||||||
shift
|
|
||||||
else
|
|
||||||
echo "Error: --var requires a non-empty string argument."
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*) echo "Unknown argument: $1"; usage ;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
echo "starting host $HOSTNAME"
|
|
||||||
echo "enable networking: $NETWORK"
|
|
||||||
echo "deploy dummy secrets: $DUMMY_SECRETS"
|
|
||||||
echo "disable disko and initrd secrets: $NO_DISKO"
|
|
||||||
echo "use writable store: $RW_STORE"
|
|
||||||
if [ -n "$VAR_PATH" ]; then
|
|
||||||
echo "sharing var directory: $VAR_PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
nix run --show-trace --impure --expr "((builtins.getFlake \"$(pwd)\").vmBuilder.x86_64-linux \"$HOSTNAME\" $NETWORK $DUMMY_SECRETS $NO_DISKO \"$VAR_PATH\" $RW_STORE $FWD_PORT).config.microvm.declaredRunner"
|
|
||||||
@@ -23,14 +23,18 @@ echo
|
|||||||
if [ $# = 1 ]
|
if [ $# = 1 ]
|
||||||
then
|
then
|
||||||
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
|
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
|
||||||
|
echo "$diskkey" | ssh $sshoptions root@$HOSTNAME-initrd "systemd-tty-ask-password-agent" #storage
|
||||||
|
|
||||||
echo "$diskkey" | ssh $sshoptions root@$HOSTNAME-initrd "systemd-tty-ask-password-agent" #root
|
echo "$diskkey" | ssh $sshoptions root@$HOSTNAME-initrd "systemd-tty-ask-password-agent" #root
|
||||||
|
|
||||||
elif [ $# = 2 ]
|
elif [ $# = 2 ]
|
||||||
then
|
then
|
||||||
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
|
diskkey=$(sops -d machines/$HOSTNAME/disk.key)
|
||||||
IP=$2
|
IP=$2
|
||||||
|
echo "$diskkey" | ssh $sshoptions root@$IP "systemd-tty-ask-password-agent" #storage
|
||||||
|
|
||||||
echo "$diskkey" | ssh $sshoptions root@$IP "systemd-tty-ask-password-agent" #root
|
echo "$diskkey" | ssh $sshoptions root@$IP "systemd-tty-ask-password-agent" #root
|
||||||
|
|
||||||
else
|
else
|
||||||
echo
|
echo
|
||||||
echo "Unlock the root disk on a remote host."
|
echo "Unlock the root disk on a remote host."
|
||||||
|
|||||||
Reference in New Issue
Block a user