Skip to content

Commit

Permalink
Merge pull request #10 from entropia/leona/profile-entropia-cluster-vm
Browse files Browse the repository at this point in the history
feat(profiles/entropia-cluster-vm): init
  • Loading branch information
xanderio authored May 7, 2024
2 parents 5868b25 + 633b46c commit 417299c
Show file tree
Hide file tree
Showing 10 changed files with 332 additions and 49 deletions.
25 changes: 25 additions & 0 deletions .sops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ keys:
- &admin_evlli_pgp 56B96D1C10D68F49E31BB8A18092413A3F6DD75F
- &admin_jcgruenhage_pgp 09E8418B46B53B0F825DE4BE018ACF465280F466
- &admin_transcaffeine_pgp 5E0A9CB3980657CB9AB94AE6790EAEC8F99AB41F
- &admin_leona_pgp EB5CEED62922C6050F9FC85BD5B08ADFC75E3605
- &host_oob_gayway_age age14ud0wf5nt2y4vh2kddasnqtdyrhl5xcrmh8py60tw9z5cw8xy9wqqyxsp6
- &host_abrechnung_age age1tcvenngz4qfgyqpxcrf9xgdygs730h83d4ln6xz99slhnaeek5fsh9xgrx

creation_rules:
- path_regex: secrets/all/[^/]+\.yaml$
Expand All @@ -16,6 +18,29 @@ creation_rules:
- *admin_jcgruenhage_pgp
- *admin_transcaffeine_pgp

- path_regex: secrets/profiles/entropia-cluster-vm.yaml
key_groups:
- age:
- *admin_xanderio_age
- *host_abrechnung_age
pgp:
- *admin_evlli_pgp
- *admin_jcgruenhage_pgp
- *admin_transcaffeine_pgp
- *admin_leona_pgp


- path_regex: secrets/hosts/abrechnung.yaml
key_groups:
- age:
- *admin_xanderio_age
- *host_abrechnung_age
pgp:
- *admin_evlli_pgp
- *admin_jcgruenhage_pgp
- *admin_transcaffeine_pgp
- *admin_leona_pgp

- path_regex: secrets/hosts/oob_gayway.yaml
key_groups:
- age:
Expand Down
54 changes: 24 additions & 30 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hosts/abrechnung/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

imports = [
./disko.nix
./hardware-configuration.nix
inputs.disko.nixosModules.disko
../../profiles/entropia-cluster-vm
];

entropia.users = [ "leona" ];
Expand Down
18 changes: 0 additions & 18 deletions hosts/abrechnung/hardware-configuration.nix

This file was deleted.

20 changes: 20 additions & 0 deletions profiles/entropia-cluster-vm/backup.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ config, ... }: {
x.sops.secrets."hosts/${config.networking.hostName}/backup_zweitwohnsitz_password" = {};

services.borgbackup.jobs.zweitwohnsitz = {
paths = [ "/var/lib" "/root" ];
exclude = [ "'**/.cache'" ];
doInit = true;
repo = "ssh://borgbackup@zweitwohnsitz.entropia.de/./${config.networking.hostName}.${config.networking.domain}";
encryption = {
mode = "repokey-blake2";
passCommand = "cat ${config.sops.secrets."hosts/${config.networking.hostName}/backup_zweitwohnsitz_password".path}";
};
environment = {
BORG_RSH = "ssh -i /etc/ssh/ssh_host_ed25519_key";
BORG_RELOCATED_REPO_ACCESS_IS_OK = "yes";
};
compression = "auto,zlib";
startAt = "daily";
};
}
15 changes: 15 additions & 0 deletions profiles/entropia-cluster-vm/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ lib, modulesPath, ... }:

{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
./backup.nix
./monitoring.nix
];

boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}
48 changes: 48 additions & 0 deletions profiles/entropia-cluster-vm/monitoring.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{ config, ... }: {
x.sops.secrets."profiles/entropia-cluster-vm/vmagent-remote-write-basic-auth-password" = {};

services.prometheus.exporters.node.enable = true;

services.vmagent = {
enable = true;
remoteWrite = {
url = "https://stats.entropia.de/prometheus/api/v1/write";
basicAuthUsername = "meow";
basicAuthPasswordFile = config.sops.secrets."profiles/entropia-cluster-vm/vmagent-remote-write-basic-auth-password".path;
};
extraArgs = [
"-remoteWrite.flushInterval=30s"
"-remoteWrite.showURL"
];
prometheusConfig = {
global = {
external_labels = {
environment = "prod";
instance = "${config.networking.hostName}.entropia.de";
};
scrape_interval = "1m";
scrape_timeout = "10s";
};
scrape_configs = [
{
job_name = "vmagent";
metrics_path = "/metrics";
static_configs = [
{
targets = [ "127.0.0.1:8429" ];
}
];
}
{
job_name = "node";
metrics_path = "/metrics";
static_configs = [
{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
}
];
}
];
};
};
}
87 changes: 87 additions & 0 deletions secrets/hosts/abrechnung.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
hosts:
abrechnung:
backup_zweitwohnsitz_password: ENC[AES256_GCM,data:PYkzTEGtg6esZXfaOMk5VyDFAsQ0+xbkXS5pEKrvtmKzL/eNprk/FDiJGhAYICoVP5I0zgvMfGU2WK090Qy9uD9vbG6yxsrq6lhjGwBAgMaN9Yt879obsFIvBHf+TLDIU2PCygHoIUkopTTlF/SEF+w06P66JYl9eqgINRC3nHo=,iv:41JHqA2ua6S6XS9P/ItLpShfl6AZnXmqjbTc+XC2G3s=,tag:6smZNN7MKA/heDPE40Bj+g==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1e9yparaev0gxwmherrjpxmfzgqga5eqdw53lrnv05s3ppjgzyceqftnwpx
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvdFhyc3BsRlhTOFdmQ1BT
YXhCNmhCa2dGY1JaNUZjTFduSE9CblRGMTJRCnloNm5jMnduNWVDU1haZnFLRnAz
cEl6NFR4bk5zMkw4YkMzdWN6dHk1SU0KLS0tIE91MW5LNks1TVJLdHE0QXVnajM2
SEgwbkhsSjdaQVhGVWwwdjdqa3NiS0kKbchCn/8pW6A2BNARVRNCbUTZLsxmFXWR
UgGTuxhyMr5/RGLamx4mdY5AIWi+4GGJIdW/k6i8Q7B5x54DMdkK3Q==
-----END AGE ENCRYPTED FILE-----
- recipient: age1tcvenngz4qfgyqpxcrf9xgdygs730h83d4ln6xz99slhnaeek5fsh9xgrx
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB5eW5KV2ZZYkl6cXFxNm04
b05TM09OcTlTa2FJOFRWd29CbEpMSmF4WkZnClhFVDBUWmxKQUo1Z3AxeGVoOGwz
QzJyNGt3UDFTZUl6N0ZPWG1IVkREdEUKLS0tIDFZdFJQejEvYk8zSWxTVlZ4Wmdz
RkMySzVYU0d3NmJwNEVPT1NNcmxpS1kK+ahIQugzPcovyndhA8f873yGCXi9VH5L
ybkC/4ZL082ANAqd+fCqqCa8TDLar5nSSTnWNsC/tMs7cFNSyNjLVA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-04-21T13:40:19Z"
mac: ENC[AES256_GCM,data:PakJCP8kB73USVidD9p4+p4y+RygZYfqdvTIi8jIgfgSvLmErHlOBY0JvYy6gYMlfgH+Ik9xiX795htfwSwVR+gt7+2a4ocA2bDfVatRygQm7D3AJX43vjV7ROw8iQkyInDFJvIfkLm+eaaqQ+QrPyjeYLap07h1nRNiDi68fcY=,iv:cDK670o8Fzkowb+SzfY4apqXThI1oOoXSNifxY3oQFA=,tag:OzlWtFulloz9o2MccN7+Mg==,type:str]
pgp:
- created_at: "2024-04-21T13:39:09Z"
enc: |-
-----BEGIN PGP MESSAGE-----
hJ4Dgju0qH8x+MoSAwMEsdhvSUciG6hrrCLFukzld93HuoqvodDM/vRLaBu02m26
pZMAqNO2Kknmo75GB1Tu8ufu1KDGq/fIDFPTIXVzCwwOmaj5nL2OZ/9Gv7mYSwO3
zknf3JjOOFbM+2BGesnZMEA7dxQ6qT6O3J0PKjLYSOZ7sEB4p3PPJndSat3wXm7h
l+swvluTP8nyiZWoaDwcINRmAQkCEJ2rAaI16Gx6EOOruwgQkMs4KrTy1hK9yeSL
dwlY/wLs2obBj5J/LZLgMU9l4qITWNIVakvdSY2jXO/DCVxum1QEBz42lWkkpa7t
tayU15xvSXHY3hBflcdrLceR3dXppaid
=BHwg
-----END PGP MESSAGE-----
fp: 56B96D1C10D68F49E31BB8A18092413A3F6DD75F
- created_at: "2024-04-21T13:39:09Z"
enc: |-
-----BEGIN PGP MESSAGE-----
hF4DQJGoFMUUQaUSAQdALD/PfmVRw+xJe3SRWsQZ1QJQApSvNSOO+p1CM1B/aXUw
LNtQNFIKZ94TlP2ahkCW45yuaCjb6GqxAr0AvcjJYngINe6oRxQXPNMTog/q9REv
0lwBTKgL95qff+TefgioWqv1/5IdNe3us3cEbE5755GU3j4Qe/qm9cYAyYBTMoYo
rqMJVRGz4Tofr8NzS9eEbVgd2Ocrf8zhloao/4NQkfHnTMUl26pzvOoS4FFjnw==
=uH7t
-----END PGP MESSAGE-----
fp: 09E8418B46B53B0F825DE4BE018ACF465280F466
- created_at: "2024-04-21T13:39:09Z"
enc: |-
-----BEGIN PGP MESSAGE-----
hQIMAxEs7W/4x4lxAQ//brvk9JWOBLFrelXRo/iLcqsPLm0SlhcPbO6FVAlkOHbF
KHOpA5t0uFBr3CK9qOxOrxLgGJQ2AbcVrAmPj4qOD/EYZtcHfOAsTas1nmbtCJVw
gnT1QauJncVWQ1doEjzpBWkJf0HNG+IWTNntX3SnAYv/mN/+kHr5056CT/WuCNbl
8Sg6tk0awCLzsbYcmdRFPiFTdmvKQYc7jiPU6qDEATTjfgZgO142D6tMQtt6k6os
2o44yInNOK0aOhXa9JMG6hf2JM1qiQce4QjpFsaZ9oAS/bbn+PUJ8kdZLArtBqBs
0bjNLzNFJ2erMFL7s7B/92mC6Eke/dpajeBfvcG9dgDQkKqK+uH45RuSiXoWnz0r
YVEpaYd2m0kqBOWKNJ0OC1DVn39WmtfNJAH8WH8e/tueB7uoo0b4hpmksydWibU1
/vjeLoebg6LT3Pvh0UEq5UpxiBRMvBrxKtumjaC0xXXYPKx/lLXNVgGhssHggnSI
6Z7IBauIeotQbH2FrGYh6RM+Z12FXO5yrNcMvTWLP4ZPY9csUBekjlcDk/Vgt5/f
1YSHVkeRZLUk0/z1EbZ6BPRTmhi3Rwr1a/dW3So8wCAXdosfL5C11V/YSpG/BMxx
Q2/mXQ38QNLhr6c5WK0RR8W4HE/pt5TAjZeeQNT1Rt0Xj6DB2pyOHCJMFFdsrr7S
XAFrszXfRNnSPvJcQ8eeo7TmdPeFEHsUwbHf78jAsIaOs5WyO6BOSpHjXOpP7UHr
YJPuA4UpfzMolrMz2lbgCUDEkH0OyZD6YrdzBe7hG7Q7b8kOV1ThY6hxSbDv
=p5JT
-----END PGP MESSAGE-----
fp: 5E0A9CB3980657CB9AB94AE6790EAEC8F99AB41F
- created_at: "2024-04-21T13:39:09Z"
enc: |-
-----BEGIN PGP MESSAGE-----
hF4D/2siLyjns28SAQdApZzPFNKFe14Fyb1Za5zc2VcekbPYhawHDx9Cf8xqnVUw
btsE5X7z4Q4z4oeALbLB+hsAmhzkLKsw8c4Un/xJrUJfMGv7BMnzThmCQnxrbMal
0lwB3NIhNHZsfL96IwQyaFYtjfPI/RaUQdLoHM10sMXD3SqPV+i2Y5Vd9fIUtKYl
1ADmjsV9jofvPZ9FlHQd7366QrTrQyO53y5cEe9ZGYD9nCqHzFQDGCLxSkLteg==
=oXvq
-----END PGP MESSAGE-----
fp: EB5CEED62922C6050F9FC85BD5B08ADFC75E3605
unencrypted_suffix: _unencrypted
version: 3.8.1
25 changes: 25 additions & 0 deletions secrets/keys/leona.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mDMEYks8uxYJKwYBBAHaRw8BAQdAjJpZIb9pVPHGA+l222xCuedZNE2Qt4WYJnV0
aEukpqm0J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gIbDBYhBOtc7tYp
IsYFD5/IW9Wwit/HXjYFBQJiSz3dBQkFo5rcAAoJENWwit/HXjYFxMUBAKL9USOi
eLPdarLxTdABhPkHoUWS2VPjb7H3d8DAlSh6AQDsAorykV3a2h++KViNc17SzLss
0OaDhSx0TqFJCMOOAQ==
=BVVI
-----END PGP PUBLIC KEY BLOCK-----
Loading

0 comments on commit 417299c

Please sign in to comment.