Switch to maestral as dropbox client

This commit is contained in:
Erwin Boskma 2023-06-04 14:21:37 +02:00
parent 5010935ae3
commit 9b6d18d9c1
Signed by: erwin
SSH key fingerprint: SHA256:9LmFDe1C6jSrEyqxxvX8NtJBmcbB105XoqyUZF092bg

View file

@ -1,4 +1,5 @@
{ lib
{ pkgs
, lib
, config
, ...
}:
@ -6,9 +7,30 @@ with lib; let
cfg = config.eboskma.programs.dropbox;
in
{
options.eboskma.programs.dropbox = { enable = mkEnableOption "activate dropbox"; };
options.eboskma.programs.dropbox = { enable = mkEnableOption "dropbox using the maestral client"; };
config = mkIf cfg.enable {
services.dropbox.enable = true;
systemd.user.services = {
maestral = {
Unit = {
Description = "Maestral daemon";
};
Service = {
Type = "notify";
NotifyAccess = "exec";
ExecStart = "${pkgs.maestral}/bin/maestral start -f";
ExecStop = "${pkgs.maestral}/bin/maestral stop";
ExecStopPost = ''${pkgs.bash}/bin/bash -c "if [[ $SERVICE_RESULT != success ]]; then notify-send Maestral 'Daemon failed'; fi"'';
WatchdogSec = "30s";
};
Install = {
WantedBy = [ "default.target" ];
};
};
};
home.packages = [ pkgs.maestral-gui pkgs.maestral ];
};
}