New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dropbox: No module named 'gi' #235345
Comments
This is admittedly off-topic, but unless you absolutely need the actual dropbox client, I cannot strongly enough recommend maestral. Been using that for years as there is a limit to the number of clients you can use with the free plan, but maestral doesn't count against that. |
@peterhoeg Do you by any chance have a sample home-manager config for maestral that will automatically start it in a systemd user based service? |
Removing this in favour of the version with syntax highlighting. Not sure why this went through as plain text...
|
Backticks for easier skimming: { config, lib, pkgs, ... }:
let
cfg = config.hoeg.programs.dropbox;
inherit (lib)
mkEnableOption mkIf mkMerge mkOption types;
commonServiceConfig = {
KillMode = "control-group"; # dropbox upstream recommends process
NotifyAccess = "main";
Restart = "on-failure";
PrivateTmp = true;
ProtectSystem = "strict";
Nice = 10;
Slice = "background.slice";
};
environment = {
HOME = "%h";
};
wantedBy = [ "graphical-session.target" ];
ini = pkgs.formats.ini { };
defaultKeyring = "keyring.backends.kwallet.DBusKeyring";
# defaultKeyring = "automatic";
# defaultKeyring = "keyring.backends.SecretService.Keyring";
maestralIni = ini.generate "maestral-override.ini" {
app = {
# if we pass a bool here, it will end up as false which makes maestral blow up
analytics = "False";
notification_level = 30; # SYNCISSUE
update_notification_interval = 0;
};
# kwallet has support for SecretService, but it doesn't seem to work
auth = {
keyring = defaultKeyring;
};
};
keyringIni = ini.generate "keyringrc.cfg" {
backend.default-keyring = defaultKeyring;
};
in
{
meta.maintainers = with lib.maintainers; [ peterhoeg ];
options.hoeg.programs.dropbox = {
enable = mkEnableOption "Dropbox/Maestral";
preferMaestral = mkOption {
description = "Prefer maestral";
type = types.bool;
default = true;
};
runGUI = mkEnableOption "Run GUI tool";
folderPath = mkOption {
description = "Path to local dropbox folder";
type = types.nullOr types.str;
default = null;
};
};
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.preferMaestral {
environment.systemPackages = [
(pkgs.maestral.overrideAttrs (old: {
# doCheck = false;
}))
];
systemd.user.services = {
maestral = rec {
description = "Maestral - OpenSource Dropbox client";
conflicts = [ "dropbox.service" ];
restartTriggers = [ maestralIni ];
wants = [ ]; # [ "kwalletd5.service" ];
# we need kwallet to be running before maestral can fetch the auth
# token, so we *need* this to be a graphical session
after = wantedBy ++ wants;
inherit environment wantedBy;
unitConfig = {
ConditionUser = "!@system";
ConditionPathExists = [
"%h/.config/maestral/maestral.ini"
# do not set this here as each machine has its own path and thus sets it itself
] ++ lib.optional (cfg.folderPath != null) cfg.folderPath;
};
serviceConfig = with pkgs; (
commonServiceConfig // {
Type = "notify";
ExecStartPre = "/bin/sh -c '${pkgs.crudini}/bin/crudini --merge $HOME/.config/maestral/maestral.ini < ${maestralIni}'";
ExecStart = "${lib.getBin maestral}/bin/maestral start --foreground";
ExecStop = "${lib.getBin maestral}/bin/maestral stop";
# ExecStopPost = ''/bin/sh -c "test "$SERVICE_RESULT" != "success" && ${pkgs.libnotify}/bin/notify-send Maestral 'Daemon failed'"'';
ExecReload = "${lib.getBin coreutils}/bin/kill -HUP $MAINPID";
EnvironmentFile = "-%t/keys/maestral";
WatchdogSec = "60s";
RuntimeDirectory = "maestral";
}
);
};
};
})
(mkIf (! cfg.preferMaestral) {
networking.firewall = {
allowedTCPPorts = [ 17500 ];
allowedUDPPorts = [ 17500 ];
};
environment.systemPackages = [ pkgs.dropbox-cli ];
systemd.user.services.dropbox = rec {
description = "Dropbox";
after = wants ++ wantedBy;
wants = [ "xembed-sni-proxy.service" ];
conflicts = [ "maestral.service" "maestral-gui.service" ];
inherit environment wantedBy;
unitConfig = {
ConditionPathExists = mkIf (cfg.folderPath != null) cfg.folderPath;
ConditionUser = "!@system";
};
serviceConfig = with pkgs; (
commonServiceConfig // {
ExecStart = "${lib.getBin dropbox}/bin/dropbox";
ExecReload = "${lib.getBin coreutils}/bin/kill -HUP $MAINPID";
}
);
};
})
]);
} |
Hi @eyJhb, I see you are listed as the Dropbox nix package maintainer. Can confirm that dropbox is broken on latest stable and unstable NixOS. Would you be willing to take a look? I'm using home-manager which doesn't say anything, but a manual |
Same issue here. |
Sorry, I no longer use Dropbox. I should most likely remove myself as maintainer :/ |
It would be great if a maestral user who's configured a working systemd user service to run the daemon could add a code snippet to https://nixos.wiki/wiki/Dropbox 🙏. |
there's this but I haven't tried it myself |
I'm also on 23.05 and dropbox (the actual client) is working fine for me. The only change is that dropbox-cli reports 'Dropbox isn't running!' if I call
|
@amacfie I found a few snippets like that on github, but they seem to store credentials in plaintext by default. I don't think the native dropbox daemon does that? |
I translated the maestral snippet above to work with home manager: systemd.user.services.maestral = {
Unit.Description = "Maestral daemon";
Install.WantedBy = [ "default.target" ];
Service = {
ExecStart = "${pkgs.maestral}/bin/maestral start -f";
ExecStop = "${pkgs.maestral}/bin/maestral stop";
Restart = "on-failure";
Nice = 10;
};
}; So far seems to work. I think a built in module that lets you do @AlexChalk not sure I understand your concern, this doesn't do anything with passwords. Unless you are saying Meastral is insecure in the way it stores the credentials? |
@AlexChalk I note you are not using the home manager module, i.e. |
On migrating from the official Dropbox client to Maestral I've also been having troubles with needing to reauthenticate often (about weekly?), and not being able to sync files with sizes over 350 GB. Assume these are limitations enforced by Dropbox but might be good to be aware of that the clients don't have feature parity. |
Perhaps Maestral needs it's own Github issue ;-) I'm not planning on migrating away from the official Dropbox client and currently the official client is broken on stable NixOS. |
I'm also experiencing this issue right on 23.05 (with home-manager). |
Describe the bug
Dropbox fails to install in new 23.05 install.
Steps To Reproduce
Expected behavior
It should start without errors.
Screenshots
As above.
Additional context
This is a new install of nixos 23.05, and dropbox installed using home-manager.
Notify maintainers
@ttuegel
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: