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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/tools: add desktopConfiguration option (to seed configuration into configuration.nix) #100199

Merged
merged 5 commits into from Oct 24, 2020

Conversation

@worldofpeace
Copy link
Contributor

@worldofpeace worldofpeace commented Oct 11, 2020

Motivation for this change

In 20.09 we added a GNOME ISO. It would be really great if, for all graphical iso's, we seed a configuration that isn't commented and only used in those respective iso's. I believe @samueldr first suggested this on the thread about adding a GNOME ISO. My current disposition is that we should block on this, I think we will have enough time to get this feature in, and it would make having another ISO feel more meaningful. If not, I'm not sure about backporting.

I also cleaned up the configuration.nix a bit, @ttuegel mentioned we should not call plasma "KDE" so I made that change to the generated configuration.nix along with some other things.

I will say, off the bat, the only issue with this is the configuration desktopConfiguration isn't indented properly. Anyone knowing perl or who can spot the mistake (I'm sleepy 馃榿 ) please mention.

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.
We don't need to actually set this as it find a good
default automatically. This could confuse the user into thinking they need
to set it themselves.
@worldofpeace
Copy link
Contributor Author

@worldofpeace worldofpeace commented Oct 11, 2020

@ofborg test nixos-generate-config

@samueldr
Copy link
Member

@samueldr samueldr commented Oct 11, 2020

Just my 2垄, but I wouldn't block the release on this new feature. If it is deemed to be really desirable, I guess backporting this self-contained feature early in the release process wouldn't be an issue.

It's not like this was a regression, we've been generating the commented-out section for a good while, so going with it for just a bit longer isn't going to cause problems.

@worldofpeace worldofpeace removed this from In progress in 20.09 Blockers Oct 11, 2020
@worldofpeace
Copy link
Contributor Author

@worldofpeace worldofpeace commented Oct 11, 2020

Just my 2垄, but I wouldn't block the release on this new feature. If it is deemed to be really desirable, I guess backporting this self-contained feature early in the release process wouldn't be an issue.

It's not like this was a regression, we've been generating the commented-out section for a good while, so going with it for just a bit longer isn't going to cause problems.

I'll take your advice as former RM 馃憤

@davidak
Copy link
Member

@davidak davidak commented Oct 12, 2020

Do i understand it correctly that the behavior should be like

  1. download GNOME ISO
  2. just install
  3. have GNOME desktop installed

that sounds very intuitive

# sound.enable = true;
# hardware.pulseaudio.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
Copy link
Member

@davidak davidak Oct 12, 2020

Suggested change
# Enable touchpad support (enabled default in most desktopManager).
# Enable touchpad support (enabled by default in most desktopManager).

@worldofpeace
Copy link
Contributor Author

@worldofpeace worldofpeace commented Oct 12, 2020

Do i understand it correctly that the behavior should be like

1. download GNOME ISO

2. just install

3. have GNOME desktop installed

that sounds very intuitive

Precisely. The most basic user should have an aligned configuration for the image they have chosen to use

We now have a GNOME ISO so it would be nice to seed that one
with configuration on how to enable it.
@worldofpeace
Copy link
Contributor Author

@worldofpeace worldofpeace commented Oct 13, 2020

Do i understand it correctly that the behavior should be like

1. download GNOME ISO

2. just install

3. have GNOME desktop installed

that sounds very intuitive

Precisely. The most basic user should have an aligned configuration for the image they have chosen to use

Though I will add that "2. just install" probably won't be a reality because they still have to configure a user manually.

@worldofpeace
Copy link
Contributor Author

@worldofpeace worldofpeace commented Oct 13, 2020

A solution for that, at least at the cli front, is that nixos-generate-config creates a users.nix to be added to the imports of configuration.nix. And maybe it can have some behavior where it prompts you for

  • single user multi user creations
  • setup password on first boot or immutable users with a hashed password (we could handle the hashing ourselves)
  • also add flags on the cli

The "setup password on first boot" is actually an option that a lot gui's I think could accommodate, like I think gnome-initial-setup can do it and in pantheon (maybe if I poke them in a way we could use). That's considered an "OEM type" install and it's actually the most convenient for the enduser for a single user system. Anyways, I'd want to steer from the discussion of having a graphical installer and then just focus on that issue of having a not so intuitive user creation.


On that note, nixos-generate-config is an actually confusing name for the tool is it not? It doesn't actually create you a really usable configuration and you can't continue to generate your config with this tool subsequently. What could be ideal is a cli tool to actually generate nix configs. @mkg20001 told me about his tool that basically does exactly this https://github.com/ssd-solar/conf-tool. It has a seed, like I'm trying to do here, but it also has templates that a distributor can setup. While I enjoy this improvement I've made here, it's nothing radical like I really want that could also be fed into making a gui installer actually viable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment