Get sed working

This commit is contained in:
Raphaël Numbus
2026-01-09 23:02:52 +01:00
parent 04e5a90b35
commit 7ad8ea057b
4 changed files with 16 additions and 15 deletions
+6 -5
View File
@@ -609,11 +609,12 @@ nix_generation() {
sed -i "s|HOME_SERVER_IP|${HOME_SERVER_IP}|g" final-nix-config/etc/nixos/misc/networking.nix sed -i "s|HOME_SERVER_IP|${HOME_SERVER_IP}|g" final-nix-config/etc/nixos/misc/networking.nix
sed -i "s|HOME_ROUTER_IP|${HOME_ROUTER_IP}|g" final-nix-config/etc/nixos/misc/networking.nix sed -i "s|HOME_ROUTER_IP|${HOME_ROUTER_IP}|g" final-nix-config/etc/nixos/misc/networking.nix
sed -i "s|TARGET_INTERFACE|${TARGET_INTERFACE}|g" final-nix-config/etc/nixos/misc/networking.nix sed -i "s|TARGET_INTERFACE|${TARGET_INTERFACE}|g" final-nix-config/etc/nixos/misc/networking.nix
sed -i "s|DOMAIN_NAME|${DOMAIN_NAME}|g" final-nix-config/etc/nixos/misc/mail.nix sed -i "s|DOMAIN_NAME|${DOMAIN_NAME}|" final-nix-config/etc/nixos/misc/mail.nix
sed -i "s|EMAIL_ADDRESS|${EMAIL_ADDRESS}|g" final-nix-config/etc/nixos/misc/mail.nix sed -i "s|EMAIL_ADDRESS|${EMAIL_ADDRESS}|" final-nix-config/etc/nixos/misc/mail.nix
sed -i "s|SENDER_MAIL_DOMAIN|${SENDER_EMAIL_DOMAIN}|g" final-nix-config/etc/nixos/misc/mail.nix sed -i "s|SENDER_MAIL_DOMAIN|${SENDER_EMAIL_DOMAIN}|" final-nix-config/etc/nixos/misc/mail.nix
sed -i "s|SENDER_MAIL_ADDRESS|${SENDER_EMAIL_ADDRESS}|g" final-nix-config/etc/nixos/misc/mail.nix sed -i "s|SENDER_MAIL_ADDRESS|${SENDER_EMAIL_ADDRESS}|" final-nix-config/etc/nixos/misc/mail.nix
sed -i "s*PODMAN_NETWORKS*${PODMAN_NETWORKS//$'\n'/\\n}*" final-nix-config/etc/nixos/misc/activation.nix sed -i "s|TRAEFIK_NETWORKS|${TRAEFIK_NETWORKS//$'\n'/\\n}|" final-nix-config/etc/nixos/podman/traefik.nix sed -i "s*PODMAN_NETWORKS*${PODMAN_NETWORKS//$'\n'/\\n}*" final-nix-config/etc/nixos/misc/activation.nix
sed -i "s|TRAEFIK_NETWORKS|${TRAEFIK_NETWORKS//$'\n'/\\n}|" final-nix-config/etc/nixos/podman/traefik.nix
sed -i "s|TRAEFIK_REF_NETWORKS|${TRAEFIK_REF_NETWORKS//$'\n'/\\n}|" final-nix-config/etc/nixos/podman/traefik.nix sed -i "s|TRAEFIK_REF_NETWORKS|${TRAEFIK_REF_NETWORKS//$'\n'/\\n}|" final-nix-config/etc/nixos/podman/traefik.nix
if [[ "${TARGET_TPM}" == "true" ]]; then if [[ "${TARGET_TPM}" == "true" ]]; then
sed -i "s|# boot.initrd.systemd.tpm2.enable = true;| boot.initrd.systemd.tpm2.enable = true;|" final-nix-config/etc/nixos/configuration.nix sed -i "s|# boot.initrd.systemd.tpm2.enable = true;| boot.initrd.systemd.tpm2.enable = true;|" final-nix-config/etc/nixos/configuration.nix
+4 -4
View File
@@ -11,22 +11,22 @@ in
fromAddress = lib.mkOption { fromAddress = lib.mkOption {
description = "The 'from' address"; description = "The 'from' address";
type = lib.types.str; type = lib.types.str;
default = "no-reply@$DOMAIN_NAME"; default = "no-reply@DOMAIN_NAME";
}; };
toAddress = lib.mkOption { toAddress = lib.mkOption {
description = "The 'to' address"; description = "The 'to' address";
type = lib.types.str; type = lib.types.str;
default = "$EMAIL_ADDRESS"; default = "EMAIL_ADDRESS";
}; };
smtpServer = lib.mkOption { smtpServer = lib.mkOption {
description = "The SMTP server address"; description = "The SMTP server address";
type = lib.types.str; type = lib.types.str;
default = "$SENDER_EMAIL_DOMAIN"; default = "SENDER_EMAIL_DOMAIN";
}; };
smtpUsername = lib.mkOption { smtpUsername = lib.mkOption {
description = "The SMTP username"; description = "The SMTP username";
type = lib.types.str; type = lib.types.str;
default = "$SENDER_EMAIL_ADDRESS"; default = "SENDER_EMAIL_ADDRESS";
}; };
smtpPasswordPath = lib.mkOption { smtpPasswordPath = lib.mkOption {
description = "Path to the secret containing SMTP password"; description = "Path to the secret containing SMTP password";
+4 -4
View File
@@ -11,15 +11,15 @@
networking.firewall.enable = true; networking.firewall.enable = true;
# Bridge configuration for VMs # Bridge configuration for VMs
networking.bridges.br0.interfaces = [ "$TARGET_INTERFACE" ]; networking.bridges.br0.interfaces = [ "TARGET_INTERFACE" ];
networking.interfaces.br0.useDHCP = false; networking.interfaces.br0.useDHCP = false;
networking.nameservers = [ "$HOME_SERVER_IP" "9.9.9.9" ]; networking.nameservers = [ "HOME_SERVER_IP" "9.9.9.9" ];
networking.interfaces.br0.ipv4.addresses = [{ networking.interfaces.br0.ipv4.addresses = [{
address = "$HOME_SERVER_IP"; address = "HOME_SERVER_IP";
prefixLength = 24; prefixLength = 24;
}]; }];
networking.defaultGateway = { networking.defaultGateway = {
address = "$HOME_ROUTER_IP"; address = "HOME_ROUTER_IP";
interface = "br0"; interface = "br0";
}; };
+2 -2
View File
@@ -18,7 +18,7 @@ in
image: docker.io/library/traefik:latest image: docker.io/library/traefik:latest
container_name: traefik container_name: traefik
networks: networks:
$TRAEFIK_NETWORKS TRAEFIK_NETWORKS
ports: ports:
- 8080:80 - 8080:80
- 8443:443 - 8443:443
@@ -39,7 +39,7 @@ $TRAEFIK_NETWORKS
- traefik.http.routers.traefik-https.tls.certresolver=cloudflare - traefik.http.routers.traefik-https.tls.certresolver=cloudflare
restart: always restart: always
networks: networks:
$TRAEFIK_REF_NETWORKS TRAEFIK_REF_NETWORKS
''; '';
systemd.services.traefik = { systemd.services.traefik = {