nixos-config/home-manager/modules/dropbox/default.nix
Erwin Boskma 4cd0f83ce8
Some checks failed
/ check (push) Failing after 2m46s
Run nixfmt
2024-02-05 11:46:52 +01:00

43 lines
913 B
Nix

{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.eboskma.programs.dropbox;
in
{
options.eboskma.programs.dropbox = {
enable = mkEnableOption "dropbox using the maestral client";
};
config = mkIf cfg.enable {
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
];
};
}