Skip to content

Soteria systemd service does not start #373290

Closed

Description

@cccslater

Describe the bug

Soteria service fails, error Failed to start Soteria, Polkit authentication agent for any desktop environment

Steps to reproduce

Steps to reproduce the behavior:

  1. enable soteria in config
  2. (might not be necessary for every WM: set systemd.targets."graphical".aliases = ["graphical-session.target"];)
  3. nixos-rebuild switch
  4. (might not be necessary if already running: systemctl --user start polkit-soteria)
  5. systemctl --user status polkit-soteria shows errors

Expected behavior

Soteria not failing

Screenshots

N/A

Additional context

Using swaywm, nixos unstable

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.6.70, NixOS, 25.05 (Warbler), 25.05.20250110.130595e
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.24.11
  • channels(root): ""
  • nixpkgs: /nix/store/cginla74w7h4gln9b3mva6l4nmj6gj30-source

Notify maintainers

@JohnRTitor


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

Activity

  1. added
    0.kind: bug
    on Jan 12, 2025
  2. cccslater commented on Jan 12, 2025

    @cccslater
    Author

    Specific error:

    Error: environment variable not found
     Location:
         src/main.rs:88:20
    

    Which corresponds to Value::new(std::env::var("XDG_SESSION_ID")?). I suppose sway doesn't set this variable

    Also, even if I run soteria manually, nautilus can't connect: gvfsd-admin: line 1: pkexec: command not found, but this is a separate issue, I think.

  3. JohnRTitor commented on Jan 13, 2025

    @JohnRTitor
    Member

    Value::new(std::env::var("XDG_SESSION_ID")?)

    Perhaps we can get upstream to lax this requirement?

    I'll investigate this later. A quick fix would be I think to configure UWSM to launch Sway. It automatically sets and manages systemd and xdg deps (including env vars).

    CC @NotAShelf soteria maintainer

  4. NotAShelf commented on Jan 13, 2025

    @NotAShelf
    Member

    I'll see if the maintainer is willing to look into this. I'm currently away from my main system and my network is too shaky to do... virtually anything.

  5. imvaskel commented on Jan 14, 2025

    @imvaskel

    Maintainer here - I have just pushed a change that should hopefully fix this and instead use the process id subject. However, I am unable to test it myself due to not having a Linux environment available. It's built via CI to garnix if you would like to try it out and report back.

  6. cccslater commented on Jan 14, 2025

    @cccslater
    Author
  7. cccslater commented on Jan 15, 2025

    @cccslater
    Author

    All sorted! I needed wayland.windowManager.sway.systemd.variables = [ "--all"] in my hm config :-) sorry for the hassle!

  8. juipeltje commented on Mar 25, 2025

    @juipeltje

    just ran into the same issue. another solution that worked for me is if you happen to be using the command dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP in your config like i do, just add XDG_SESSION_ID to the end of that command. (btw thanks @cccslater for figuring out which environment variable it was :) )

  9. imvaskel commented on Mar 26, 2025

    @imvaskel

    I've done a bit of testing and the above solution is the one I recommend if your desktop environment does not properly set environment variables.

  10. NikunjK8 commented on Dec 18, 2025

    @NikunjK8

    just ran into the same issue. another solution that worked for me is if you happen to be using the command dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP in your config like i do, just add XDG_SESSION_ID to the end of that command. (btw thanks @cccslater for figuring out which environment variable it was :) )

    Do you add this in your window manager config?

  11. juipeltje commented on Dec 18, 2025

    @juipeltje

    just ran into the same issue. another solution that worked for me is if you happen to be using the command dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP in your config like i do, just add XDG_SESSION_ID to the end of that command. (btw thanks @cccslater for figuring out which environment variable it was :) )

    Do you add this in your window manager config?

    yes. It depends on which window manager you use, but in Sway for example you just put it as an exec line in your config, similar to how you autostart other programs.

  12. NikunjK8 commented on Dec 19, 2025

    @NikunjK8

    yes. It depends on which window manager you use, but in Sway for example you just put it as an exec line in your config, similar to how you autostart other programs.

    Got it, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions