refactor: extract home directory path into 'home'

This commit is contained in:
2026-08-24 20:04:36 +02:00
parent 385c26f3a0
commit 7c283c61c4
3 changed files with 10 additions and 8 deletions
+2 -1
View File
@@ -3,6 +3,7 @@
let
cfg = config.syncthing;
inherit (config.host) username;
home = config.users.users.${username}.home;
deviceRegistry = import ./devices.nix;
deviceName = lib.types.enum (builtins.attrNames deviceRegistry);
@@ -48,7 +49,7 @@ in
enable = true;
user = username;
group = username;
configDir = "/home/${username}/.local/state/syncthing";
configDir = "${home}/.local/state/syncthing";
openDefaultPorts = true;
settings = {
devices = lib.mapAttrs (_: id: { inherit id; }) (lib.getAttrs referencedDevices deviceRegistry);