Difference between revisions of "Dropbox"

From NixOS Wiki
Jump to: navigation, search
(add module config by peterhoeg)
 
Line 1: Line 1:
 +
== Using the package ==
 +
 +
Install the <literal>dropbox</literal> package after enabling [https://nixos.wiki/wiki/FAQ#How_can_I_install_a_proprietary_or_unfree_package.3F unfree packages].
 +
Then start the dropbox command, which will download the real dropbox binary and start it.
 +
 
== Configure Dropbox as a Service on NixOS ==
 
== Configure Dropbox as a Service on NixOS ==
 
As of right now ( 2019-01-02 ) there is no dropbox module in nixpkgs, however [https://discourse.nixos.org/t/using-dropbox-on-nixos/387/6 peterhoeg at discourse.nixos.org] shared the service code he is using:
 
As of right now ( 2019-01-02 ) there is no dropbox module in nixpkgs, however [https://discourse.nixos.org/t/using-dropbox-on-nixos/387/6 peterhoeg at discourse.nixos.org] shared the service code he is using:

Revision as of 07:34, 12 January 2019

Using the package

Install the <literal>dropbox</literal> package after enabling unfree packages. Then start the dropbox command, which will download the real dropbox binary and start it.

Configure Dropbox as a Service on NixOS

As of right now ( 2019-01-02 ) there is no dropbox module in nixpkgs, however peterhoeg at discourse.nixos.org shared the service code he is using:

{
  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;
    };
  };
}