-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
Flatpaks with DBusActivatable=true
fail to start through menu
#138956
Comments
Try this, maybe it'll give a error or something |
Pre-requisite would be Flatpak linking D-Bus service files to a well-known location. Not sure if it currently does that. https://developer.gnome.org/documentation/guidelines/maintainer/integrating.html#d-bus-activation |
@Artturin there is nothing. Tbh i don't get how this helps. FWIW gnome-maps (also with dbus actication) installed with nix works; the gnome-maps flatpak not. |
@jtojnar on both my Fedora Silverblue machine and NixOS machine the services are symlinked to the same location if that's what you mean.
|
Maybe we need to add
https://github.com/NixOS/nixpkgs/blob/63ec2613bd109c36d29aaf015152da92a7984f7f/pkgs/development/libraries/dbus/make-dbus-conf.nix |
Did you try adding the path to |
yes
|
this is what i have for now it does find the geany service file but it if someone wants to try: this patch applied to nixos-unstable branch diff --git a/nixos/modules/services/desktops/flatpak.nix b/nixos/modules/services/desktops/flatpak.nix
index 7da92cc9f26..868714ce603 100644
--- a/nixos/modules/services/desktops/flatpak.nix
+++ b/nixos/modules/services/desktops/flatpak.nix
@@ -28,11 +28,59 @@ in {
}
];
- environment.systemPackages = [ pkgs.flatpak ];
+ environment.systemPackages = [ pkgs.flatpak pkgs.xdg-dbus-proxy pkgs.dbus-broker ];
- services.dbus.packages = [ pkgs.flatpak ];
+ services.dbus.packages = [ pkgs.flatpak /*"/var/lib/flatpak/exports"*/ ];
- systemd.packages = [ pkgs.flatpak ];
+ systemd.services.dbus-broker = {
+ path = [ pkgs.flatpak ];
+ enable = true;
+ aliases = [ "dbus.service" ];
+ # Don't restart dbus-daemon. Bad things tend to happen if we do.
+ reloadIfChanged = true;
+ restartTriggers = [ "/etc/dbus-1" ];
+ environment = { LD_LIBRARY_PATH = config.system.nssModules.path; };
+ };
+ systemd.user.services.dbus-broker = {
+ path = [ pkgs.flatpak ];
+ enable = true;
+ wantedBy = [ "default.target" ];
+ aliases = [ "dbus.service" ];
+ # Don't restart dbus-daemon. Bad things tend to happen if we do.
+ reloadIfChanged = true;
+ restartTriggers = [ "/etc/dbus-1" ];
+ environment = { LD_LIBRARY_PATH = config.system.nssModules.path; };
+ };
+
+ #systemd.services.dbus = {
+ # enable = true;
+ # aliases = [ "dbus.service" ];
+ #};
+ #systemd.user.services.dbus = {
+ # enable = true;
+ # aliases = [ "dbus.service" ];
+ #};
+
+ systemd.sockets.dbus = {
+ description = "D-Bus System Message Bus Socket";
+ wantedBy = [ "sockets.target" ];
+ socketConfig = {
+ ListenStream = "/run/dbus/system_bus_socket";
+ };
+ };
+
+ systemd.user.sockets.dbus = {
+ description = "D-Bus System Message Bus Socket";
+ wantedBy = [ "sockets.target" ];
+ socketConfig = {
+ ListenStream = "%t/bus";
+ ExecStartPost = "-/run/current-system/systemd/bin/systemctl --user set-environment DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus";
+ };
+ };
+ #systemd.services.dbus.enable = false;
+ #systemd.user.services.dbus.enable = false;
+
+ systemd.packages = [ pkgs.flatpak pkgs.dbus-broker ];
environment.profiles = [
"$HOME/.local/share/flatpak/exports"
diff --git a/nixos/modules/services/system/dbus.nix b/nixos/modules/services/system/dbus.nix
index d4cacb85694..85eb4350f73 100644
--- a/nixos/modules/services/system/dbus.nix
+++ b/nixos/modules/services/system/dbus.nix
@@ -102,7 +102,7 @@ in
users.groups.messagebus.gid = config.ids.gids.messagebus;
- systemd.packages = [ pkgs.dbus.daemon ];
+ #systemd.packages = [ pkgs.dbus.daemon ];
security.wrappers.dbus-daemon-launch-helper = {
source = "${pkgs.dbus.daemon}/libexec/dbus-daemon-launch-helper";
diff --git a/pkgs/os-specific/linux/dbus-broker/default.nix b/pkgs/os-specific/linux/dbus-broker/default.nix
index b7e0a6b6158..631c173e1ed 100644
--- a/pkgs/os-specific/linux/dbus-broker/default.nix
+++ b/pkgs/os-specific/linux/dbus-broker/default.nix
@@ -23,6 +23,11 @@ stdenv.mkDerivation rec {
PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
PKG_CONFIG_SYSTEMD_CATALOGDIR = "${placeholder "out"}/lib/systemd/catalog";
+ postPatch = ''
+ substituteInPlace src/launch/launcher.c \
+ --replace "/usr/share/dbus-1" "${dbus.daemon}/share/dbus-1"
+ '';
+
postInstall = ''
install -Dm644 $src/README.md $out/share/doc/dbus-broker/README
{
inputs = {
#nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "/home/artturin/nixgits/my-nixpkgs";
#nixpkgs.url = "path:../nixgits/nixpkgs1";
#pkgsReview.url = "github:Artturin/nixpkgs/pipewirejackldpath";
#pkgsReview.url = "path:../nixgits/my-nixpkgs";
};
outputs = inputs@{ self, nixpkgs, /*pkgsReview*/ }: {
nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
({ pkgs, ... }: {
#hardware.video.hidpi.enable = true;
})
({ pkgs, ... }: {
#disabledModules = [ "services/desktops/pipewire/pipewire.nix" ];
imports = [
#"${inputs.pkgsReview}/nixos/modules/services/desktops/pipewire/pipewire.nix"
#"${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/iso-image.nix"
#"${inputs.nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
## For virtualisation settings
"${inputs.nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
"${inputs.nixpkgs}/nixos/modules/profiles/clone-config.nix"
"${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix"
];
environment.systemPackages = with pkgs; [
(neovim.override { viAlias = true; vimAlias = true;})
ranger
ripgrep
tree
#firefox
];
#hardware.pulseaudio.enable = true;
services.xserver = {
enable = true;
#displayManager.lightdm = {
# enable = true;
#};
displayManager.autoLogin = {
user = "user";
enable = true;
};
desktopManager.gnome = {
enable = true;
};
};
environment.gnome.excludePackages = with pkgs.gnome; [
gnome-weather
gnome-calendar
gnome-maps
gnome-contacts
gnome-software
gnome-calculator
gnome-calendar
gnome-characters
gnome-clocks
gnome-font-viewer
gnome-logs
gnome-maps
gnome-music
pkgs.gnome-photos
totem
epiphany
geary
gnome-disk-utility
seahorse
sushi
evince
cheese
eog
baobab
pkgs.evolution
gnome-backgrounds
];
services.flatpak.enable = true;
# Documentation for these is in nixos/modules/virtualisation/qemu-vm.nix
virtualisation = {
memorySize = 1024 * 3;
diskSize = 1024 * 4;
cores = 8;
};
programs = {
zsh.enable = true;
};
environment.etc."zshrc.local" = { source = "${pkgs.grml-zsh-config}/etc/zsh/zshrc"; };
boot.tmpOnTmpfs = true;
#boot.tmpOnTmpfsSize = "80%";
documentation.enable = false;
users.mutableUsers = false;
users.defaultUserShell = pkgs.zsh;
users.users.root = {
password = "root";
};
users.users.user = {
password = "user";
isNormalUser = true;
extraGroups = [ "wheel" ];
};
})
];
};
# So that we can just run 'nix run' instead of
# 'nix build ".#nixosConfigurations.vm.config.system.build.vm" && ./result/bin/run-nixos-vm'
defaultPackage.x86_64-linux = self.nixosConfigurations.vm.config.system.build.vm;
defaultApp.x86_64-linux = {
type = "app";
program = "${self.defaultPackage.x86_64-linux}/bin/run-nixos-vm";
};
};
}
|
I marked this as stale due to inactivity. → More info |
I am still having this issue in 22.05 and the 22.11 unstable channel. I get the following log output when trying to launch one of the Flatpaks in question: |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/some-flatpaks-fail-to-launch-from-launcher-icon/20818/3 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/some-flatpaks-fail-to-launch-from-launcher-icon/20818/4 |
The patch hasn't been applied to unstable. The issue still persists... |
Here's my fix for the issue if you use { pkgs, ... }:
{
systemd.packages = [
(pkgs.writeTextFile {
name = "flatpak-dbus-overrides";
destination = "/etc/systemd/user/dbus-.service.d/flatpak.conf";
text = ''
[Service]
ExecSearchPath=${pkgs.flatpak}/bin
'';
})
];
} This "solution" is based on the fact
The drop-in is used to point systemd to where it could find flatpak. EDIT: Updated to not use |
Same issue on unstable |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/boxes-flatpak-wont-start/28702/4 |
Having the same issue on nixos unstable channel |
Same issue on 23.05 |
I'm experiencing the same behaviour in sway with gnome.nautilus and flatpaks. However, the error I receive from .nautilus-wrapp gives |
This seems like quite a critical issue, any updates? Same error. ➜ ~ gapplication launch org.gnome.Boxes
error sending Activate message to application: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program org.gnome.Boxes: No such file or directory
➜ ~ |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/flatpak-telegram-desktop-desktop-entry-problems/31374/1 |
Describe the bug
When trying to start a flatpak which contains
DBusActivatable=true
in its .desktop file it refuses to start (tested in GNOME shell). Commenting outDBusActivatable=true
(tested in copied .desktop to home dir) or justflatpak run ....
seems to work fine.Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Flatpak should open.
Notify maintainers
@jtojnar
Metadata
The text was updated successfully, but these errors were encountered: