feat: dropbox

This commit is contained in:
Madeleine Sydney
2024-12-29 02:58:41 -07:00
parent 10dfd4e502
commit e4a0777c19
4 changed files with 67 additions and 7 deletions

33
modules/nixos/dropbox.nix Normal file
View File

@@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.sydnix.dropbox;
in {
options = {
sydnix.dropbox = {
enable = mkEnableOption "Dropbox";
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.dropbox-cli ];
systemd.user.services.dropbox = {
description = "Dropbox";
wantedBy = [ "graphical-session.target" ];
environment = {
QT_PLUGIN_PATH = "/run/current-system/sw/" + pkgs.qt5.qtbase.qtPluginPrefix;
QML2_IMPORT_PATH = "/run/current-system/sw/" + pkgs.qt5.qtbase.qtQmlPrefix;
};
serviceConfig = {
ExecStart = "${lib.getBin pkgs.dropbox}/bin/dropbox";
ExecReload = "${lib.getBin pkgs.coreutils}/bin/kill -HUP $MAINPID";
KillMode = "control-group"; # upstream recommends process
Restart = "on-failure";
PrivateTmp = true;
ProtectSystem = "full";
Nice = 10;
};
};
};
}