1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 18:21:07 +01:00
Files
niveum/modules/dropbox.nix

35 lines
824 B
Nix
Raw Normal View History

2022-03-10 21:52:12 +01:00
{
pkgs,
lib,
config,
...
}:
with lib; let
cfg = config.niveum.dropbox;
in {
2022-03-10 21:52:12 +01:00
options.niveum.dropbox = {enable = mkEnableOption "Dropbox";};
2019-04-19 03:11:51 +02:00
config = mkIf cfg.enable {
2022-03-10 21:52:12 +01:00
environment.systemPackages = [pkgs.dropbox-cli];
2020-11-05 21:29:47 +01:00
networking.firewall = {
2022-03-10 21:52:12 +01:00
allowedTCPPorts = [17500];
allowedUDPPorts = [17500];
2020-11-05 21:29:47 +01:00
};
systemd.user.services.dropbox = {
2019-06-08 14:56:11 +02:00
description = "Dropbox synchronisation service";
2022-03-10 21:52:12 +01:00
wantedBy = ["graphical-session.target"];
2019-06-08 14:56:11 +02:00
serviceConfig = {
2020-11-05 21:29:47 +01:00
ExecStart = "${pkgs.dropbox.out}/bin/dropbox";
ExecReload = "${pkgs.coreutils.out}/bin/kill -HUP $MAINPID";
KillMode = "control-group"; # upstream recommends process
Restart = "on-failure";
PrivateTmp = true;
ProtectSystem = "full";
Nice = 10;
2019-06-08 14:56:11 +02:00
};
};
2019-04-19 03:11:51 +02:00
};
}