snowfall lib migration wip

This commit is contained in:
Aleksandr Lebedev 2025-08-07 18:07:27 +02:00
parent b9dadac2af
commit ed08a98651
31 changed files with 1067 additions and 172 deletions

View file

@ -19,22 +19,24 @@ in {
options.${namespace}.services.syncthing = with types; {
enable = mkBoolOpt false "Enable syncthing service for the user";
user = lib.mkOption {
type = lib.types.singleLineStr;
default = "";
example = "nixos";
description = ''
User, that will use the syncthing service (only one at a time)
'';
};
type = lib.types.singleLineStr;
default = "";
example = "nixos";
description = ''
User, that will use the syncthing service (only one at a time)
'';
};
};
config =
mkIf cfg.enable {
systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder
services.syncthing = {
inherit (cfg) user;
configDir = optional (impermanence.enable) "${impermanence.persistentStorage}/home/${cfg.user}/.config/syncthing";
enable = true;
};
config = mkIf cfg.enable {
systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder
services.syncthing = {
inherit (cfg) user;
configDir =
if impermanence.enable
then "${impermanence.persistentStorage}/home/${cfg.user}/.config/syncthing"
else "/home/${cfg.user}/.config.syncthing";
enable = true;
};
};
}