mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 13:39:46 +01:00
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
This commit is contained in:
parent
2e7935767f
commit
bb6eb9b13e
1 changed files with 17 additions and 17 deletions
|
@ -36,7 +36,7 @@ in {
|
||||||
Install = { WantedBy = [ "default.target" ]; };
|
Install = { WantedBy = [ "default.target" ]; };
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Environment = [ "HOME=${homeBaseDir}" ];
|
Environment = [ "HOME=${homeBaseDir}" "DISPLAY=" ];
|
||||||
|
|
||||||
Type = "forking";
|
Type = "forking";
|
||||||
PIDFile = "${homeBaseDir}/.dropbox/dropbox.pid";
|
PIDFile = "${homeBaseDir}/.dropbox/dropbox.pid";
|
||||||
|
@ -49,16 +49,6 @@ in {
|
||||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||||
ExecStop = "${dropboxCmd} stop";
|
ExecStop = "${dropboxCmd} stop";
|
||||||
ExecStart = toString (pkgs.writeShellScript "dropbox-start" ''
|
ExecStart = toString (pkgs.writeShellScript "dropbox-start" ''
|
||||||
if [[ ! -f $HOME/.dropbox-dist/VERSION ]]; then
|
|
||||||
${pkgs.coreutils}/bin/yes | ${dropboxCmd} update
|
|
||||||
fi
|
|
||||||
|
|
||||||
${dropboxCmd} start
|
|
||||||
'');
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
home.activation.dropbox = hm.dag.entryAfter [ "writeBoundary" ] ''
|
|
||||||
# ensure we have the dirs we need
|
# ensure we have the dirs we need
|
||||||
$DRY_RUN_CMD ${pkgs.coreutils}/bin/mkdir $VERBOSE_ARG -p \
|
$DRY_RUN_CMD ${pkgs.coreutils}/bin/mkdir $VERBOSE_ARG -p \
|
||||||
${homeBaseDir}/{.dropbox,.dropbox-dist,Dropbox}
|
${homeBaseDir}/{.dropbox,.dropbox-dist,Dropbox}
|
||||||
|
@ -68,10 +58,20 @@ in {
|
||||||
$DRY_RUN_CMD ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \
|
$DRY_RUN_CMD ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \
|
||||||
${homeBaseDir}/.dropbox ${config.home.homeDirectory}/.dropbox
|
${homeBaseDir}/.dropbox ${config.home.homeDirectory}/.dropbox
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -d ${escapeShellArg cfg.path} ]]; then
|
if [[ ! -d ${escapeShellArg cfg.path} ]]; then
|
||||||
$DRY_RUN_CMD ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \
|
$DRY_RUN_CMD ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \
|
||||||
${homeBaseDir}/Dropbox ${escapeShellArg cfg.path}
|
${homeBaseDir}/Dropbox ${escapeShellArg cfg.path}
|
||||||
fi
|
fi
|
||||||
'';
|
|
||||||
|
# get the dropbox bins if needed
|
||||||
|
if [[ ! -f $HOME/.dropbox-dist/VERSION ]]; then
|
||||||
|
${pkgs.coreutils}/bin/yes | ${dropboxCmd} update
|
||||||
|
fi
|
||||||
|
|
||||||
|
${dropboxCmd} start
|
||||||
|
'');
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue