mirror of
https://github.com/kmein/niveum
synced 2026-03-20 03:51:07 +01:00
feat: take dropbox module from dropbox
This commit is contained in:
@@ -5,17 +5,24 @@ in {
|
|||||||
options.niveum.dropbox = { enable = mkEnableOption "Dropbox"; };
|
options.niveum.dropbox = { enable = mkEnableOption "Dropbox"; };
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ pkgs.dropbox-cli ];
|
||||||
|
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPorts = [ 17500 ];
|
||||||
|
allowedUDPPorts = [ 17500 ];
|
||||||
|
};
|
||||||
|
|
||||||
systemd.user.services.dropbox = {
|
systemd.user.services.dropbox = {
|
||||||
description = "Dropbox synchronisation service";
|
description = "Dropbox synchronisation service";
|
||||||
after = [ "network.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
wantedBy = [ "default.target" ];
|
|
||||||
path = [ pkgs.dropbox-cli ];
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "forking";
|
ExecStart = "${pkgs.dropbox.out}/bin/dropbox";
|
||||||
PIDFile = "%h/.dropbox/dropbox.pid";
|
ExecReload = "${pkgs.coreutils.out}/bin/kill -HUP $MAINPID";
|
||||||
Restart = "always";
|
KillMode = "control-group"; # upstream recommends process
|
||||||
ExecStart = "${pkgs.dropbox-cli}/bin/dropbox start";
|
Restart = "on-failure";
|
||||||
ExecStop = "${pkgs.dropbox-cli}/bin/dropbox stop";
|
PrivateTmp = true;
|
||||||
|
ProtectSystem = "full";
|
||||||
|
Nice = 10;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user