From bae990279cdb68e56c3ded24c471a300c558ed23 Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Mon, 2 Dec 2024 00:17:25 -0500 Subject: [PATCH] Replace absolute path /home In 24.11 this is no longer allowed but is easy to grab from config --- modules/home-manager/common/hm-sops.nix | 8 ++++---- modules/hosts/nixos/bigboy/default.nix | 6 +++--- modules/hosts/nixos/hetznix01/post-install/default.nix | 6 +++--- modules/hosts/nixos/hetznix02/post-install/default.nix | 8 ++++---- modules/hosts/nixos/nixnas1/default.nix | 8 ++++---- modules/hosts/nixos/nixnuc/default.nix | 6 +++--- modules/hosts/nixos/rainbow-planet/default.nix | 6 +++--- modules/system/common/linux/lets-encrypt.nix | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/modules/home-manager/common/hm-sops.nix b/modules/home-manager/common/hm-sops.nix index 215aa7c..946935b 100644 --- a/modules/home-manager/common/hm-sops.nix +++ b/modules/home-manager/common/hm-sops.nix @@ -1,14 +1,14 @@ -{ pkgs, hostname, username, ... }: { +{ config, pkgs, hostname, username, ... }: { home.packages = with pkgs; [ home-manager ]; sops = { - age.keyFile = /home/${username}/.config/sops/age/keys.txt; + age.keyFile = "${config.users.users.${username}.home}/.config/sops/age/keys.txt"; defaultSopsFile = ../hosts/${hostname}/secrets.yaml; secrets = { - local_git_config.path = "/home/${username}/.gitconfig-local"; - local_private_env.path = "/home/${username}/.private-env"; + local_git_config.path = "${config.users.users.${username}.home}/.gitconfig-local"; + local_private_env.path = "${config.users.users.${username}.home}/.private-env"; }; }; } diff --git a/modules/hosts/nixos/bigboy/default.nix b/modules/hosts/nixos/bigboy/default.nix index cca6970..96b3c2f 100644 --- a/modules/hosts/nixos/bigboy/default.nix +++ b/modules/hosts/nixos/bigboy/default.nix @@ -151,16 +151,16 @@ }; sops = { - age.keyFile = /home/${username}/.config/sops/age/keys.txt; + age.keyFile = "${config.users.users.${username}.home}/.config/sops/age/keys.txt"; defaultSopsFile = ./secrets.yaml; secrets = { local_git_config = { owner = "${username}"; - path = "/home/${username}/.gitconfig-local"; + path = "${config.users.users.${username}.home}/.gitconfig-local"; }; local_private_env = { owner = "${username}"; - path = "/home/${username}/.private-env"; + path = "${config.users.users.${username}.home}/.private-env"; }; }; }; diff --git a/modules/hosts/nixos/hetznix01/post-install/default.nix b/modules/hosts/nixos/hetznix01/post-install/default.nix index e1a6e50..fbd4ffc 100644 --- a/modules/hosts/nixos/hetznix01/post-install/default.nix +++ b/modules/hosts/nixos/hetznix01/post-install/default.nix @@ -76,16 +76,16 @@ in { }; sops = { - age.keyFile = /home/${username}/.config/sops/age/keys.txt; + age.keyFile = "${config.users.users.${username}.home}/.config/sops/age/keys.txt"; defaultSopsFile = ../secrets.yaml; secrets = { local_git_config = { owner = "${username}"; - path = "/home/${username}/.gitconfig-local"; + path = "${config.users.users.${username}.home}/.gitconfig-local"; }; local_private_env = { owner = "${username}"; - path = "/home/${username}/.private-env"; + path = "${config.users.users.${username}.home}/.private-env"; }; matrix_secrets_yaml = { owner = config.users.users.matrix-synapse.name; diff --git a/modules/hosts/nixos/hetznix02/post-install/default.nix b/modules/hosts/nixos/hetznix02/post-install/default.nix index 4d07495..abef4ef 100644 --- a/modules/hosts/nixos/hetznix02/post-install/default.nix +++ b/modules/hosts/nixos/hetznix02/post-install/default.nix @@ -1,15 +1,15 @@ -{ username, ... }: { +{ config, username, ... }: { sops = { - age.keyFile = /home/${username}/.config/sops/age/keys.txt; + age.keyFile = "${config.users.users.${username}.home}/.config/sops/age/keys.txt"; defaultSopsFile = ../secrets.yaml; secrets = { local_git_config = { owner = "${username}"; - path = "/home/${username}/.gitconfig-local"; + path = "${config.users.users.${username}.home}/.gitconfig-local"; }; local_private_env = { owner = "${username}"; - path = "/home/${username}/.private-env"; + path = "${config.users.users.${username}.home}/.private-env"; }; tailscale_key = { restartUnits = [ "tailscaled-autoconnect.service" ]; diff --git a/modules/hosts/nixos/nixnas1/default.nix b/modules/hosts/nixos/nixnas1/default.nix index 14e1f3a..da6853f 100644 --- a/modules/hosts/nixos/nixnas1/default.nix +++ b/modules/hosts/nixos/nixnas1/default.nix @@ -1,4 +1,4 @@ -{ pkgs, username, ... }: { +{ config, pkgs, username, ... }: { imports = [ ./disk-config.nix ./hardware-configuration.nix @@ -62,16 +62,16 @@ }; sops = { - age.keyFile = /home/${username}/.config/sops/age/keys.txt; + age.keyFile = "${config.users.users.${username}.home}/.config/sops/age/keys.txt"; defaultSopsFile = ./secrets.yaml; secrets = { local_git_config = { owner = "${username}"; - path = "/home/${username}/.gitconfig-local"; + path = "${config.users.users.${username}.home}/.gitconfig-local"; }; local_private_env = { owner = "${username}"; - path = "/home/${username}/.private-env"; + path = "${config.users.users.${username}.home}/.private-env"; }; }; }; diff --git a/modules/hosts/nixos/nixnuc/default.nix b/modules/hosts/nixos/nixnuc/default.nix index 7fd10a0..8d8bfad 100644 --- a/modules/hosts/nixos/nixnuc/default.nix +++ b/modules/hosts/nixos/nixnuc/default.nix @@ -486,16 +486,16 @@ in { }; sops = { - age.keyFile = /home/${username}/.config/sops/age/keys.txt; + age.keyFile = "${config.users.users.${username}.home}/.config/sops/age/keys.txt"; defaultSopsFile = ./secrets.yaml; secrets = { local_git_config = { owner = "${username}"; - path = "/home/${username}/.gitconfig-local"; + path = "${config.users.users.${username}.home}/.gitconfig-local"; }; local_private_env = { owner = "${username}"; - path = "/home/${username}/.private-env"; + path = "${config.users.users.${username}.home}/.private-env"; }; mealie.mode = "0444"; nextcloud_admin_pass.owner = config.users.users.nextcloud.name; diff --git a/modules/hosts/nixos/rainbow-planet/default.nix b/modules/hosts/nixos/rainbow-planet/default.nix index 574a254..bcf7986 100644 --- a/modules/hosts/nixos/rainbow-planet/default.nix +++ b/modules/hosts/nixos/rainbow-planet/default.nix @@ -125,16 +125,16 @@ }; sops = { - age.keyFile = /home/${username}/.config/sops/age/keys.txt; + age.keyFile = "${config.users.users.${username}.home}/.config/sops/age/keys.txt"; defaultSopsFile = ./secrets.yaml; secrets = { local_git_config = { owner = "${username}"; - path = "/home/${username}/.gitconfig-local"; + path = "${config.users.users.${username}.home}/.gitconfig-local"; }; local_private_env = { owner = "${username}"; - path = "/home/${username}/.private-env"; + path = "${config.users.users.${username}.home}/.private-env"; }; tailscale_key = { restartUnits = [ "tailscaled-autoconnect.service" ]; diff --git a/modules/system/common/linux/lets-encrypt.nix b/modules/system/common/linux/lets-encrypt.nix index 0105a8d..1903df1 100644 --- a/modules/system/common/linux/lets-encrypt.nix +++ b/modules/system/common/linux/lets-encrypt.nix @@ -20,7 +20,7 @@ }; sops = { - age.keyFile = /home/${username}/.config/sops/age/keys.txt; + age.keyFile = "${config.users.users.${username}.home}/.config/sops/age/keys.txt"; secrets.gandi_api.sopsFile = ../secrets.yaml; }; }