refactor: reduce duplication and improve consistency across hosts

- Centralize home-manager _module.args in profiles/nixos.nix via sharedModules
- Add lib/secrets.nix with mkSyncthingSecrets helper for DRY secret definitions
- Move syncthing device IDs to lib/constants.nix
- Standardize hostname handling (Darwin hosts now use hostname arg)
- Add missing networking.hostName to tahani
- Fix redundant string interpolations
This commit is contained in:
2025-12-23 14:13:47 +00:00
parent 4f93e60f3c
commit 1d8a0c660c
14 changed files with 95 additions and 85 deletions

View File

@@ -2,7 +2,7 @@
inputs,
pkgs,
user,
constants,
hostname,
...
}: {
imports = [
@@ -18,8 +18,8 @@
inputs.sops-nix.darwinModules.sops
];
networking.hostName = "chidi";
networking.computerName = "Chidi";
networking.hostName = hostname;
networking.computerName = hostname;
home-manager.users.${user} = {
imports = [

View File

@@ -1,18 +1,14 @@
{user, ...}: {
{
user,
hostname,
...
}: let
secrets = import ../../lib/secrets.nix;
in {
sops.age.keyFile = "/Users/${user}/.config/sops/age/keys.txt";
sops.secrets = {
chidi-syncthing-cert = {
sopsFile = ../../secrets/chidi-syncthing-cert;
format = "binary";
owner = user;
path = "/Users/${user}/.config/syncthing/cert.pem";
};
chidi-syncthing-key = {
sopsFile = ../../secrets/chidi-syncthing-key;
format = "binary";
owner = user;
path = "/Users/${user}/.config/syncthing/key.pem";
};
sops.secrets = secrets.mkSyncthingSecrets {
inherit hostname user;
isDarwin = true;
};
}