-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
gnome-flashback: add option to remove gnome-panel, auto-generate wmName #113957
Conversation
6cfb7ce
to
ba63f7d
Compare
@@ -160,15 +160,9 @@ in | |||
customSessions = mkOption { | |||
type = types.listOf (types.submodule { | |||
options = { | |||
wmName = mkOption { |
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.
you should use mkRemovedOption~
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.
Unfortunately I don't think that works because the option is in a submodule. I added an assertion.
dafbc54
to
fe79988
Compare
@worldofpeace friendly bump, this is very useful if you want to run gnome flashback and a tiling WM such as i3. |
requiredComponents = wmName: enableGnomePanel: "RequiredComponents=${lib.concatStringsSep ";" ([ wmName ] ++ requiredComponentsCommon enableGnomePanel ++ requiredComponentsGsd)};"; | ||
|
||
# Make an ASCII filename-friendly name for a wm configuration, similar to Nix. | ||
mkWmName = args@{ wmLabel, wmCommand, enableGnomePanel }: builtins.substring 0 32 (builtins.hashString "sha256" (builtins.toJSON args)); |
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.
A benefit of human readable name is that it is clearer in the logs.
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.
I think this is better for the user, since this name is only needed internally and this way it can't be named in a way that breaks things.
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.
Alternately, we might use slugify wmLabel
as the default value for the name and make it optional. Possibly suffix it with the hash to avoid conflicts.
slugify =
let
allowed = lib.lowerChars ++ lib.upperChars ++ lib.stringToCharacters "1234567890-_";
in
lib.stringAsChars (c: if builtins.elem c allowed then c else "_");
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.
And types.strMatching "[a-zA-Z0-9_-]+"
for the option would work.
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.
I think it's fine how it is now. This identifier is only needed to get GNOME to find it internally, and exposing it would be a leaky abstraction IMO.
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.
Actually, I just remembered that the identifier is needed for auto-login (services.xserver.displayManager.defaultSession
) so this is technically another BC break.
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.
Yeah, this is not particularly nice:
trace: Default graphical session, 'gnome-flashback-xmonad', not found.
Valid names for 'services.xserver.displayManager.defaultSession' are:
gnome
gnome-xorg
gnome-flashback-Metacity-4175ca004519ae58f559894fbcaadd3f
gnome-flashback-XMonad-8382231e25a9fde7159467bbc610bdbf
sm.puri.Phosh
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.
BC break
@jtojnar What's "BC"?
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.
@nh2 backwards compatibility
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.
@jtojnar OK fair enough, I put the wmName
back in.
But generally, it looks okay so if you do not think these are worth addressing, we can merge it as is. |
fe79988
to
d1d7b1c
Compare
I've tried it on top of latest master but the custom session doesn't seem to work due to some systemd issues. I don't really know too much about that stuff, could you maybe take a look @worldofpeace? |
They left the project. I will try to take a look when I have some more time. |
Do you have any error message? |
@jtojnar I'm not sure what the exact thing is, but the WM doesn't seem to start. The systemd unit we use in the |
Oh, I see. The systemd units containing I suspect that before, the whole Likely, to prevent that, upstream decided to switch to drop-in overrides, which use the original instance auto-created by systemd from So I would just copy what is now in the package, just like we did before. Do not forget to adjust to the new unit name. |
d1d7b1c
to
351ff96
Compare
@jtojnar OK, it seems to work now! |
351ff96
to
a85e371
Compare
c2e1800
to
da1e70d
Compare
The docs should be updated as well. Otherwise, looks good. |
da1e70d
to
620ff94
Compare
620ff94
to
424cd7d
Compare
Can confirm that it works, thanks. |
This PR enables many Gnome services by default without setting any gnome related option:
I noticed this because it breaks any configuration with nix-instantiate ./nixos --arg configuration '{
fileSystems."/".fsType = "tmpfs";
boot.loader.grub.device = "/dev/null";
networking.wireless.enable = true;
}'
error:
Failed assertions:
- You can not use networking.networkmanager with networking.wireless.
Except if you mark some interfaces as <literal>unmanaged</literal> by NetworkManager. |
@jtojnar I know there were plans to allow enabling flashback but not gnome shell, was this done? If not, we should only apply flashback configs if gnome is enabled right? |
Did not realize this is not conditional on gnome-flashback being enabled. Partially reverts #113957
Sorry about that, I forgot we do not have a separate |
Did not realize this is not conditional on gnome-flashback being enabled. Partially reverts NixOS#113957
I wanted to remove the
wmName
option since it would fail if it wasn't in the right format. I also added a flag to disable the GNOME panel.sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)