hlissner / dotfiles

And I say hey, what's going on?
https://youtu.be/ZZ5LpwO-An4
MIT License
1.62k stars 98 forks source link

Suggestion: Update quickstart section in README #23

Closed sdaros closed 2 years ago

sdaros commented 3 years ago

I just recently used the quick start instructions in the README to provision a new laptop, and I figured that it may be helpful for others (who aren't very familiar with the nix flakes approach) to clarify the quickstart section in the README. My suggestion would be something along the following lines:

  1. switch to root user with sudo su -
  2. nix-shell -p git nixFlakes
  3. git clone https://github.com/hlissner/dotfiles /mnt/etc/nixos
  4. Install NixOS: USER= nixos-install --impure --root /mnt --flake /mnt/etc/nixos#XYZ, where XYZ is the host you want to install. Use #generic for a simple, universal config, or create a sub-directory in hosts/ for your device. See host/kuro for an example. If you added a folder in hosts/ don't forget to git add hosts/new_folder_for_host before running nixos-install. Reboot!

I think just adding the --impure flag by default and reminding users to do a git add host/new_folder_for_host would be sufficient for new comers.

halikular commented 2 years ago

What is meant by this?

Install NixOS: USER=<your_user_name_here>

You enter username before nixos-install?

sdaros commented 2 years ago

Yes that's correct. You enter your username as environment variable before the nixos-install command.

The reason for this is that you are executing the nixos-install command as the root user (since you switched to the root user using sudo su - in step 4), but when setting up your system you usually want to also create a non-privileged, normal user as well and this works when you set the environment variable USER=your_user_name (see https://github.com/hlissner/dotfiles/blob/master/modules/options.nix#L40-L41)

hlissner commented 2 years ago

I've updated the quickstart instructions in 809ee25 with your suggestions and then some. Thanks for the help!