fix: fix networking issues on pie

This commit is contained in:
Benjamin Bädorf 2023-10-24 15:54:18 +02:00
parent 34d60a9c7b
commit dd42eeca69
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C
6 changed files with 36 additions and 39 deletions

View file

@ -32,6 +32,7 @@ in {
port = 2222;
authorizedKeys = psCfg.user.publicKeys;
hostKeys = ["/etc/secrets/initrd/ssh_host_ed25519_key"];
shell = "/bin/cryptsetup-askpass";
};
# See https://discourse.nixos.org/t/ssh-and-network-in-initrd-on-raspberry-pi-4/6289/3
boot.initrd.availableKernelModules = [ "genet" ];

View file

@ -9,6 +9,9 @@ with lib; let
psCfg = config.pub-solar;
xdg = config.home-manager.users."${psCfg.user.name}".xdg;
getIP4 = with pkgs; writeShellScriptBin "getIP" ''
${curl}/bin/curl -4 https://ipcheck-ds.wieistmeineip.de/callback/ | ${coreutils}/bin/tail -c +2 | ${coreutils}/bin/head -c -1 | ${jq}/bin/jq '.ip' -r
'';
getIP6 = with pkgs; writeShellScriptBin "getIP" ''
${curl}/bin/curl -6 https://ipcheck-ds.wieistmeineip.de/callback/ | ${coreutils}/bin/tail -c +2 | ${coreutils}/bin/head -c -1 | ${jq}/bin/jq '.ip' -r
'';
@ -26,6 +29,7 @@ in {
];
server = "ddns.hosting.de";
username = "b12f";
usev4 = "cmdv4, cmdv4=${getIP4}/bin/getIP";
usev6 = "cmdv6, cmdv6=${getIP6}/bin/getIP";
verbose = true;
passwordFile = "/run/agenix/dyndns.key";

View file

@ -74,7 +74,6 @@ in {
];
extraOptions = [ "--network=firefly" ];
environmentFiles = [
./.env.firefly-importer
config.age.secrets."firefly-db-secrets.env".path
];
};
@ -88,6 +87,7 @@ in {
FIREFLY_III_URL = "http://firefly.b12f.io/";
};
environmentFiles = [
./.env.firefly-importer
config.age.secrets."firefly-importer-secrets.env".path
];
dependsOn = [ "firefly" ];

View file

@ -12,6 +12,7 @@ in {
age.secrets."invoiceplane-db-password.age" = {
file = "${flake.self}/secrets/invoiceplane-db-password.age";
mode = "600";
owner = "invoiceplane";
};
age.secrets."invoiceplane-db-secrets.env" = {
@ -27,7 +28,7 @@ in {
name = "invoiceplane";
passwordFile = config.age.secrets."invoiceplane-db-password.age".path;
host = "localhost";
port = 5432;
port = 3306;
createLocally = false;
};
};
@ -36,11 +37,11 @@ in {
oci-containers = {
backend = "docker";
containers."invoiceplane-db" = {
image = "postgres:16";
image = "mariadb:11";
autoStart = true;
ports = [ "5432:5432" ];
ports = [ "3306:3306" ];
volumes = [
"/var/lib/invoiceplane/db:/var/lib/postgresql/data"
"/var/lib/invoiceplane/db:/var/lib/mysql"
];
environmentFiles = [
config.age.secrets."invoiceplane-db-secrets.env".path
@ -64,7 +65,8 @@ in {
# See https://www.hosting.de/blog/verschluesselte-backups-mit-rclone-und-restic-in-nextcloud/
repository = "rclone:cloud.pub.solar:/backups/InvoicePlane";
backupPrepareCommand = ''
${pkgs.docker-client}/bin/docker exec -t invoiceplane-db pg_dumpall -c -U invoiceplane > "${backupDir}/postgres.sql"
PW=$(cat ${config.age.secrets."invoiceplane-db-password.age".path})
${pkgs.docker-client}/bin/docker exec -t invoiceplane-db mariadb-dump --all-databases --password=$PW --user=invoiceplane > "${backupDir}/postgres.sql"
'';
rcloneConfigFile = config.age.secrets."rclone-pie.conf".path;
};

View file

@ -12,19 +12,10 @@
interface = "enabcm6e4ei0";
};
networking.interfaces.enabcm6e4ei0.ipv4.addresses = [
{
address = "192.168.178.2";
prefixLength = 32;
}
];
networking.interfaces.enabcm6e4ei0.ipv6.addresses = [
{
address = "2a02:908:5b1:e3c0:3077:2::";
prefixLength = 128;
}
];
networking.interfaces.enabcm6e4ei0 = {
ipv4.addresses = [ { address = "192.168.178.2"; prefixLength = 32; } ];
ipv6.addresses = [ { address = "2a02:908:5b1:e3c0:3077:2::"; prefixLength = 128; } ];
};
networking.hosts = flake.self.lib.addLocalHostname ["caddy.local"];
networking.firewall.allowedTCPPorts = [ 80 ];

View file

@ -1,21 +1,20 @@
age-encryption.org/v1
-> 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