many changes this one forgot
This commit is contained in:
parent
67c2117563
commit
44307a3f6f
22 changed files with 1081 additions and 437 deletions
28
modules/user-services/syncthing.nix
Normal file
28
modules/user-services/syncthing.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.xyno.user-services.syncthing;
|
||||
in
|
||||
{
|
||||
options.xyno.user-services.syncthing.enable = lib.mkEnableOption "enable syncthing as user/with gui";
|
||||
options.xyno.user-services.syncthing.wantedBy = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "niri.service";
|
||||
};
|
||||
options.xyno.user-services.syncthing.tray = lib.mkEnableOption "add syncthingtray";
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.syncthing = {
|
||||
systemService = false;
|
||||
enable = true;
|
||||
openDefaultPorts = true;
|
||||
};
|
||||
environment.systemPackages = lib.optionals cfg.tray [ pkgs.syncthingtray ];
|
||||
systemd.packages = lib.optionals cfg.tray [ pkgs.syncthingtray ];
|
||||
systemd.user.services.syncthing.wantedBy = [ cfg.wantedBy ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue