Created
March 22, 2019 14:17
-
-
Save phdoerfler/9443550e81be3220c568e15d5849ca18 to your computer and use it in GitHub Desktop.
Dropbox in NixOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix | |
./mount.nix | |
./dropbox.nix | |
]; | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, ... }: | |
{ | |
environment.systemPackages = with pkgs; [ | |
# dropbox - we don't need this in the environment. systemd unit pulls it in | |
dropbox-cli | |
]; | |
networking.firewall = { | |
allowedTCPPorts = [ 17500 ]; | |
allowedUDPPorts = [ 17500 ]; | |
}; | |
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 = "${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; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment