Skip to content
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

nixos/lightdm-gtk-greeter: make it overridable by other greeters #44926

Closed
wants to merge 2 commits into from

Conversation

mnacamura
Copy link
Contributor

@mnacamura mnacamura commented Aug 12, 2018

Motivation for this change

So that we do not have to care about the order to import greeters modules:

# Note: the order in which lightdm greeter modules are imported
# here determines the default: later modules (if enable) are
# preferred.
imports = [
./lightdm-greeters/gtk.nix
./lightdm-greeters/mini.nix
];

Moreover, I added the second commit in which gtk greeter is disabled automatically if any other greeter is enabled. Currently, every time when adding a greeter module, one has to add

services.xserver.displayManager.lightdm.greeters.gtk.enable = false;

in the config section. By this PR, no need to do it.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@mnacamura mnacamura changed the title lightdm: ensure at most one greeter enabled lightdm: ensure exactly one greeter enabled if auto-login is disabled Aug 12, 2018
@mnacamura mnacamura force-pushed the exclusive-greeters branch 2 times, most recently from 04d06ed to ea69845 Compare August 13, 2018 15:04
@infinisil infinisil self-assigned this Aug 13, 2018
@mnacamura
Copy link
Contributor Author

Is this build error on the second commit relevant to this PR? Do I need to fix something?

@infinisil
Copy link
Member

This is definitely not the way to implement this.

I think this can be done by simply removing gtk.enable = false; from mini.nix, and replacing the mkDefault at the bottom of gtk.nix with mkOptionDefault. Then any greeter will be able to override the gtk default, and only one can be enabled because the options services.xserver.displayManager.lightdm.greeter.{package,name} can only be assigned once.

@mnacamura
Copy link
Contributor Author

That's better! Remaining problem is that unnecessary /etc/lightdm/lightdm-gtk-greeter.conf appears even if the other greeter is enabled.

@mnacamura mnacamura changed the title lightdm: ensure exactly one greeter enabled if auto-login is disabled nixos/lightdm-gtk-greeter: do not install unnecessary configuration file Aug 19, 2018
@mnacamura mnacamura changed the title nixos/lightdm-gtk-greeter: do not install unnecessary configuration file nixos/lightdm-gtk-greeter: make it overridable by other greeters Aug 19, 2018
@mnacamura
Copy link
Contributor Author

@infinisil Rewrote it based on your idea. Thanks.


environment.etc."lightdm/lightdm-gtk-greeter.conf".source = gtkGreeterConf;
})
(mkIf (ldmcfg.greeter.name == "lightdm-gtk-greeter") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this also be conditioned on ldmcfg.enable and cfg.enable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@mnacamura
Copy link
Contributor Author

mnacamura commented Dec 11, 2018

Rebased this PR. I removed services.xserver.displayManager.lightdm.greeters.gtk.enable = mkDefault false in lightdm-greeters/enso-os.nix as well as lightdm-greeters/mini.nix.

@mmahut
Copy link
Member

mmahut commented Aug 12, 2019

Are there any updates on this pull request, please?

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 3, 2020
@stale
Copy link

stale bot commented Jun 5, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 5, 2021
@lucasew
Copy link
Contributor

lucasew commented Aug 24, 2022

Is it still relevant?

@Artturin Artturin closed this Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants