2024-02-05 11:46:52 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
2022-03-01 22:19:03 +01:00
|
|
|
}:
|
2024-02-05 11:46:52 +01:00
|
|
|
with lib;
|
|
|
|
let
|
2022-03-01 22:19:03 +01:00
|
|
|
cfg = config.eboskma.programs.dropbox;
|
2022-04-27 00:21:19 +02:00
|
|
|
in
|
|
|
|
{
|
2024-02-05 11:46:52 +01:00
|
|
|
options.eboskma.programs.dropbox = {
|
|
|
|
enable = mkEnableOption "dropbox using the maestral client";
|
|
|
|
};
|
2021-12-10 20:11:36 +01:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2023-06-04 14:21:37 +02:00
|
|
|
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" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-02-05 11:46:52 +01:00
|
|
|
home.packages = [
|
|
|
|
pkgs.maestral-gui
|
|
|
|
pkgs.maestral
|
|
|
|
];
|
2021-12-10 20:11:36 +01:00
|
|
|
};
|
|
|
|
}
|