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/sddm: use attrs instead of plain text #107724

Merged
merged 1 commit into from Dec 28, 2020
Merged

Conversation

peterhoeg
Copy link
Member

Motivation for this change

Instead of treating the sddm config a wall of text that doesn't allow us
to override anything, turn it into an attribute set.

We dump extraConfig and instead introduce settings that is merged
with the module defaults to provide the final configuration.

There is some additional noise in here due to nixpkgs-fmt.

We totally should do this everywhere where we are currently just doing a bunch of text but the expected format is one for which we have a generator available (ini, yaml, json, toml).

A few minor additional things:

  1. make the minimum UID for autologin configurable instead of hard-coding 1000
  2. remove references to /bin/sh in the generated scripts
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

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

Awesome! In addition to the comments I left I think it would be better to have a few commits instead of mixing together... if that's not too much a hassle.

[ "services" "xserver" "displayManager" "sddm" "autoLogin" "user" ]
[ "services" "xserver" "displayManager" "autoLogin" "user" ]
)
(mkRenamedOptionModule
Copy link
Member

Choose a reason for hiding this comment

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

Different type so you should use mkRemovedOptionModule and mention the new option.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, fixed.

type = types.lines;
default = "";
settings = mkOption {
type = types.attrs;
Copy link
Member

Choose a reason for hiding this comment

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

We have some fancy pants new types available. Take a look at this, specifically format = pkgs.formats.ini {};.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice, thanks, fixed.

@peterhoeg
Copy link
Member Author

@GrahamcOfBorg build tests.sddm

Instead of treating the sddm config a wall of text that doesn't allow us
to override anything, turn it into an attribute set.

We dump `extraConfig` and instead introduce `settings` that is merged
with the module defaults to provide the final configuration.

There is some additional noise in here due to nixpkgs-fmt.
@peterhoeg
Copy link
Member Author

@GrahamcOfBorg build tests.sddm

@peterhoeg
Copy link
Member Author

@GrahamcOfBorg test sddm

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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

2 participants