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
Make socket activated user dbus session mandatory #97801
Conversation
I'll add a note to the 21.03 release notes when the file is added. |
I think in xserver.nix we still do |
https://github.com/NixOS/nixpkgs/blob/master/nixos/doc/manual/release-notes/rl-2103.xml is already there actually |
@worldofpeace The PR also removes the @xaverdh Cool, I'll update the PR. |
b4e956e
to
a6feaa5
Compare
@@ -0,0 +1,25 @@ | |||
#!/run/current-system/sw/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the shebang here necessary at all? Does it work in a sandboxed build or non-sandboxed build on non-NixOS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the shebang is not serving any function beside helping the editor and shellcheck detect that the code is expected to be Bash compatible.
I changed to a more generic #!/usr/bin/env bash
line, though, that is probably more familar.
This hook moves systemd user service file from `lib/systemd/user` to `share/systemd/user`. This is to allow systemd to find the user services when installed into a user profile. The `lib/systemd/user` path does not work since `lib` is not in `XDG_DATA_DIRS`.
a6feaa5
to
a1d5df6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Maybe change the wording to make clear dbus is socket-activated if it is enabled at all, so no one thinks you made dbus uncondititonal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM yay!
@Ericson2314 Yes, that's a good idea. I'll make that change, just waiting for everything to rebuild (again 😉). |
This removes the `services.dbus.socketActivated` and `services.xserver.startDbusSession` options. Instead the user D-Bus session is always socket activated.
a1d5df6
to
f292a27
Compare
@Ericson2314 Done. |
Thanks for the merge @worldofpeace. It'll be very nice to be able to rely on people having a functional dbus even in non-graphical logins 😀 |
How likely is this PR landing in 20.09? |
Unlikely, considering branch-off happened last week. |
@bb010g I would be very much against trying to get this into 20.09. Since it involves a stdenv change I haven't been able to comprehensive test due to the amount of rebuilds necessary (https://nixbuild.net/ has helped a lot but still it is a slow process) so I imagine there might be some cases that have not been covered. It will absolutely have to stabilize in staging-next and master for some time. |
This change makes it very hard to have the same configuration for unstable and stable. Could we at least make |
This PR used mkRemovedOptionModule, which as described in modules.nix
should not throw a hard error. Can you please paste a trace etc.? |
let
configuration = { config, pkgs, ... }: {
services.dbus.socketActivated = true;
};
nixos = import <nixpkgs/nixos> { configuration = configuration; };
in nixos.vm
|
I've made a PR: #101408 |
And I made an alternative PR #101409 that turns this specific dbus assertion error into a warning. Please have a look. |
This makes the systemd module use the sd-switch application to perform the unit switch during a generation activation. Since the closure of sd-switch is relatively lightweight we unconditionally pull it in as a dependency. We simultaneously remove the `systemd.user.startServices` option and perform the switch action automatically. This is the second attempt at introducing this change, the first being 9c0fe39, which was quickly reverted 223e3c3 since the feature didn't work on systems where the user is not given a functional dbus session. Since the user session is now always socket activated, see [0], we can (hopefully) safely reintroduce the feature. [0] NixOS/nixpkgs#97801
This makes the systemd module use the sd-switch application to perform the unit switch during a generation activation. Since the closure of sd-switch is relatively lightweight we unconditionally pull it in as a dependency. We simultaneously remove the `systemd.user.startServices` option and perform the switch action automatically. This is the second attempt at introducing this change, the first being 9c0fe39, which was quickly reverted 223e3c3 since the feature didn't work on systems where the user is not given a functional dbus session. Since the user session is now always socket activated, see [0], we can (hopefully) safely reintroduce the feature. [0] NixOS/nixpkgs#97801
Motivation for this change
Removes non-socket activated user D-Bus session. To do this it was also necessary to add a hook that moves systemd user units to a place discoverable through
XDG_DATA_DIRS
. Replaces #67942.Many CPU hours have died to bring us these two commits.