snowfall lib migration wip
This commit is contained in:
parent
b9dadac2af
commit
ed08a98651
31 changed files with 1067 additions and 172 deletions
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue