feat(services): add synology drive module
This commit is contained in:
parent
6fad257d5b
commit
f58c8dc6f8
6 changed files with 39 additions and 11 deletions
|
|
@ -1,12 +1,13 @@
|
|||
{
|
||||
imports = [
|
||||
./dunst.nix
|
||||
./gammastep.nix
|
||||
./kdeconnect.nix
|
||||
./mullvad.nix
|
||||
./openconnect.nix
|
||||
./picom.nix
|
||||
./printing.nix
|
||||
./gammastep.nix
|
||||
./synology-drive.nix
|
||||
./wireguard.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
32
modules/services/synology-drive.nix
Normal file
32
modules/services/synology-drive.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.my.services.synology-drive;
|
||||
in
|
||||
{
|
||||
options.my.services.synology-drive = {
|
||||
enable = mkEnableOption "synology-drive";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.synology-drive-client;
|
||||
description = "The package to use for synology-drive";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.user.services.synology-drive = {
|
||||
after = [ "graphical-session.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
ExitType = "cgroup";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "1s";
|
||||
ExecStartPre = "${pkgs.coreutils}/bin/rm -rf %h/.SynologyDrive/SynologyDrive.app %h/.SynologyDrive/cloud-connect.pid";
|
||||
ExecStart = "${cfg.package}/bin/synology-drive";
|
||||
};
|
||||
};
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue