-
Notifications
You must be signed in to change notification settings - Fork 8
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
Services requiring WAYLAND_DISPLAY
cannot access it with Niri on NixOS
#40
Comments
Most likely your Plus your log does not include results of |
I'm getting a similar issue and I don't think its because of an ordering issue. Waybar is giving an error that it cannot open the display when I restart it after I'm in niri. I've also set I believe niri does something similar to hyprland where it notifies systemd of startup. So this could be a similar issue to #14. |
Status of swayidle.service:
Which means it was started earlier than units of
|
Plus niri exports |
Something else I noticed is that when I run |
Please show configuration of |
I've noticed that as well, |
Please show unit configurations of services that fail. |
Here is the service unit for # /home/etho/.config/systemd/user/swayidle.service
[Install]
WantedBy=graphical-session.target
[Service]
Environment=PATH=/nix/store/vpvy79k1qq02p1vyqjk6nb89gwhxqvyb-bash-5.2p32/bin
ExecStart=/nix/store/b11svzm1gjnb2qrgc56qybrmqk7444yl-swayidle-1.8.0/bin/swayidle -w timeout 300 '/nix/store/szxalsfcjw62lw4h6n31z4499kw5saia-check-audio-script || /run/current-system/sw/bin/niri msg action power-off-monitors' timeout 900 '/nix/store/szxalsfcjw62lw4h6n31z4499kw5saia-check-audio-script || /run/current-system/sw/bin/systemctl suspend-then-hibernate' before-sleep '/run/current-system/sw/bin/loginctl lock-session' lock /nix/store/yd7mixw0p2pq37bpv4i3048zicfjbwkq-swaylock-1.7.2/bin/swaylock
Restart=always
Type=simple
[Unit]
ConditionEnvironment=WAYLAND_DISPLAY
Description=Idle manager for Wayland
Documentation=man:swayidle(1)
PartOf=graphical-session.target |
It lacks ordering, which means it will fire up right away in any transaction that includes Add |
I had this issue even when setting After and Slice. I used the example waybar unit in this repo and waybar gave the error |
This indeed fixes the service ordering, now Waybar starts properly without needing to run
Here’s how the service is declared in the Home Manager module: https://github.com/nix-community/home-manager/blob/8a1671642826633586d12ac3158e463c7a50a112/modules/services/swayidle.nix#L117 Could this be related to how the service environment is handled? |
Could it be that Home Manager module overwrites units? What if you add ordering to a drop-in? It would probably be a good idea to patch the module with |
I was wrong about slice ordering: it does not affect ordering of included units. On contrary, unit assigned to some |
I've opened a PR to fix the swayidle module, but I noticed that similar services like |
To my knowledge compositors bind either directly or via an intermediate to
Waybar or hypridle, like any wayland apps, require compositor to run, so they should go |
This issue should be reopened, as the initial problem persists: This issue does not occur when using the |
I've been using UWSM for a couple of days without issues (although IDK if this is the correct usage). Here are some code snippets: NixOS config{ config, lib, pkgs, ... }:
let
# wrapper script for `binPath` since the option type is `path`
niriSession = lib.getExe (
pkgs.writeShellScriptBin "niriSession" ''
${lib.getExe config.programs.niri.package } --session
''
);
in
{
programs.uwsm = {
enable = true;
waylandCompositors = {
niri = {
prettyName = "niri";
comment = "niri compositor managed by UWSM";
binPath = niriSession;
};
};
};
} Home Manager config{
systemd.user.swayidle.Unit.After = [ "graphical-session.target" ];
} |
With v0.19.x graphical session is delayed until |
@Brisingr05, Passing I didn't think of trying again with this flag, as I assumed it wasn't necessary when using UWSM. Btw the @Vladimir-csp, Is running |
In general, if compositor puts |
I'm trying to set up a session for Niri with the NixOS module, but no matter what I do, services that require
WAYLAND_DISPLAY
fail to start properly.Here’s what I’ve tried so far:
[email protected]
or[email protected]
--session
flagsystemctl --user reset-failed && /run/current-system/sw/bin/uwsm finalize NIRI_SOCKET
in the Niri configuration’sspawn-at-startup
uwsm
package with the following content:Logs:
The text was updated successfully, but these errors were encountered: