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

30 lines
824 B
Nix

{ pkgs, lib, config, ... }:
with lib;
let cfg = config.niveum.dropbox;
in {
options.niveum.dropbox = { enable = mkEnableOption "Dropbox"; };
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.dropbox-cli ];
networking.firewall = {
allowedTCPPorts = [ 17500 ];
allowedUDPPorts = [ 17500 ];
};
systemd.user.services.dropbox = {
description = "Dropbox synchronisation service";
wantedBy = [ "graphical-session.target" ];
serviceConfig = {
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;
};
};
};
}