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.xserver: assert that either desktop- or window manager is not "none" #30517
services.xserver: assert that either desktop- or window manager is not "none" #30517
Conversation
I'm not fond of this. Especially since it breaks my setup, which uses
|
But what if we just want to use a plain X session? |
interesting, didn't know there are people using X without a DM or a WM. Just out of interest: what's the reason for a plain X session? |
I'm using Home Manager to manage my X session. It mainly uses systemd user services started from ~/.xsession. |
@Ma27 I'm not using without a DM/WM, but I find it quite useful as a debug step sometimes to figure out if an issue is due to the window manager, or say a regression in X sometimes (and obviously knowing that can save a lot of time). Also helps with debugging say a video driver with not so good linux kernel support, since you can rule out potential effects of DM/WM. (And the NixOS generations feature makes this easy to test as well.) I'm not opposed to say some configuration option that allows this, since my use case is admittedly rare, I just don't want it to be impossible. Edit: That way, the user has explicitly made clear that they know what they're doing. And maybe the evaluation error could also mention that you would need to set an option for this, somehow? |
Yep 👍 |
@rycee if you're fine with this, I'd implement that additional option. If not, I'd consider closing this for now :-) |
bb38700
to
59ff939
Compare
@vyp just found some time to implement this. Would you mind having a look at the change to confirm that this is a better solution? :) |
Yeah, I think this is a decent compromise. I would prefer a name more along the lines of |
@Ma27 unfortunately am really busy (time-sensitive) for at least a few days so afraid not right now. :/ (only just have time for making short responses from my phone when traveling tbh, if you're curious) |
59ff939
to
2ae8633
Compare
rebased onto latest master which should fix the build.
I don't like this as setting a DM/WM doesn't prohibit overriding the XSession file. The only reason why this option exists is to "tell" Nix whether plain X sessions without a DM/WM are allowed.
ok, I'll try to summarize it for you: I added an option |
I'm fine with this. But I am thinking that it warrants a release note since it is a change that will break some people's installs. In particular, it should be clear what steps you need to take (enable |
makes sense, will add this :-) |
2ae8633
to
86625cd
Compare
@rycee done :-) |
Thanks! |
type = types.bool; | ||
default = false; | ||
description = '' | ||
Whether the X11 session can be plain (without DM/WM) or not. |
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.
This description should explain that the Xsession is then used as a fallback.
86625cd
to
a5244cf
Compare
@nbp done :-) |
@@ -552,6 +561,9 @@ in | |||
+ "${toString (length primaryHeads)} heads set to primary: " | |||
+ concatMapStringsSep ", " (x: x.output) primaryHeads; | |||
}) | |||
{ assertion = cfg.desktopManager.default == "none" && cfg.windowManager.default == "none" -> cfg.plainX; | |||
message = "Either the desktop manager or the window manager shouldn't be `none`!"; |
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.
The best error message is the error message which let you fix the issue which is being reported.
This message should include some hint to fix the configuration.
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.
agreed. Added another sentence which mentions the plainX
option ...
c2388e0
to
2752358
Compare
hmm, I am quite unhappy with this (since my rebuild just broke) Some sort of default should be figured out automatically. |
I'm not 100% sure what you mean, sorry. |
This is what I do to add XMonad to any config of mine: I am already defining that I want to enable xmonad. Why should I have to add it again to "default"? |
I added an option
Sounds good, will think about this, however my I'm not sure how many time I'll have for this in the next days... |
How is that possible to have both default to none, when there is one window manager enabled? I thought this code used to pick the only active element as the default. I guess we should back it out, and figure out the issue with the default computation. |
enable a WM/DM != setting a default value. |
I think the default should be the only enabled WM/DM if any, and otherwise be the first one, or none if multiple. |
makes sense, will open a PR in the next days for that... |
…er is not "none"" This reverts commit 93c54ac. This reopens #30517 @nbp @Ma27 Breaking people's config for this is hardly reasonable as is. If it absolutely cannot be avoided, at the very least, we need to provide clear instructions on what people need to upgrade in their config. I actually had to bisect to the commit, to even find out what property I should change or define, as the error message was useless. It didn't even mention a property name. Discussion on the PR seems to be ongoing, so I'm reverting this, so we don't break people's systems on unstable.
Motivation for this change
setting a DM or WM is something I tend to forget when I want to built test machines with an X11 inside, so this assertion might catch unexpected behavior when building machines with X.
resolves #11064 (/cc @nbp )
I tested this against the following expressions:
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)