aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authoreyjhb <eyjhbb@gmail.com>2020-07-29 23:59:08 +0200
committerRobert Helgesson <robert@rycee.net>2020-07-30 00:07:23 +0200
commitbb6eb9b13e3d40a22633fb80cbc75347af5bed3c (patch)
tree60e9e2570f015eb2b28cc97030a0fa366a634c6f /modules
parent2e7935767f2bc49ec45cd7a92289a208882c1797 (diff)
dropbox: fix bug caused by Python `gi` import
When running the service start script with `DISPLAY` set, a `gi` import error is triggered. Blanking the variable will make the script use a different code path that does not attempt to import `gi`. Also moves activation script up into start of script instead. PR #1415
Diffstat (limited to 'modules')
-rw-r--r--modules/services/dropbox.nix34
1 files changed, 17 insertions, 17 deletions
diff --git a/modules/services/dropbox.nix b/modules/services/dropbox.nix
index fa8a2fc52f5..bcf3ba2b457 100644
--- a/modules/services/dropbox.nix
+++ b/modules/services/dropbox.nix
@@ -36,7 +36,7 @@ in {
Install = { WantedBy = [ "default.target" ]; };
Service = {
- Environment = [ "HOME=${homeBaseDir}" ];
+ Environment = [ "HOME=${homeBaseDir}" "DISPLAY=" ];
Type = "forking";
PIDFile = "${homeBaseDir}/.dropbox/dropbox.pid";
@@ -49,6 +49,22 @@ in {
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
ExecStop = "${dropboxCmd} stop";
ExecStart = toString (pkgs.writeShellScript "dropbox-start" ''
+ # ensure we have the dirs we need
+ $DRY_RUN_CMD ${pkgs.coreutils}/bin/mkdir $VERBOSE_ARG -p \
+ ${homeBaseDir}/{.dropbox,.dropbox-dist,Dropbox}
+
+ # symlink them as needed
+ if [[ ! -d ${config.home.homeDirectory}/.dropbox ]]; then
+ $DRY_RUN_CMD ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \
+ ${homeBaseDir}/.dropbox ${config.home.homeDirectory}/.dropbox
+ fi
+
+ if [[ ! -d ${escapeShellArg cfg.path} ]]; then
+ $DRY_RUN_CMD ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \
+ ${homeBaseDir}/Dropbox ${escapeShellArg cfg.path}
+ fi
+
+ # get the dropbox bins if needed
if [[ ! -f $HOME/.dropbox-dist/VERSION ]]; then
${pkgs.coreutils}/bin/yes | ${dropboxCmd} update
fi
@@ -57,21 +73,5 @@ in {
'');
};
};
-
- home.activation.dropbox = hm.dag.entryAfter [ "writeBoundary" ] ''
- # ensure we have the dirs we need
- $DRY_RUN_CMD ${pkgs.coreutils}/bin/mkdir $VERBOSE_ARG -p \
- ${homeBaseDir}/{.dropbox,.dropbox-dist,Dropbox}
-
- # symlink them as needed
- if [[ ! -d ${config.home.homeDirectory}/.dropbox ]]; then
- $DRY_RUN_CMD ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \
- ${homeBaseDir}/.dropbox ${config.home.homeDirectory}/.dropbox
- fi
- if [[ ! -d ${escapeShellArg cfg.path} ]]; then
- $DRY_RUN_CMD ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \
- ${homeBaseDir}/Dropbox ${escapeShellArg cfg.path}
- fi
- '';
};
}