dustinlyons / nixos-config

General purpose Nix configuration for macOS / NixOS with starter templates + step-by-step guides ✨
BSD 3-Clause "New" or "Revised" License
1.79k stars 113 forks source link

installation not working when device is not named /dev/nvme* #21

Closed TonyBostonTB closed 1 year ago

TonyBostonTB commented 1 year ago

My disk's name is sda but the installer doesn't recognize it

...
+ sgdisk --set-alignment=2048 --align-end --new=1:0:+100M --change-name=1:disk-vdb-ESP --typecode=1:EF00 /dev/nvme0n1
Problem opening /dev/nvme0n1 for reading! Error is 2.
The specified file does not exist!
dustinlyons commented 1 year ago

Sorry about that, I'll get a patch out shortly.

dustinlyons commented 1 year ago

Okay, I've made this change:

I haven't had time to test it, however, I think it's correct. If you want to give it a try, just follow the steps as you did before and run bin/apply. If there are any errors, they are likely syntactical, as I didn't introduce anything new or novel. This means I can quickly fix them, or the bin/apply script may require minor edits on your end.

Essentially, we need the correct device name in the nixos/disk-config.nix file. The bin/apply script assists in doing that by replacing the token %DISK% found inside nixos/disk-config.nix with the user's input.

Let me know how it goes.

Thank you!

TonyBostonTB commented 1 year ago

Since I have to issue following command sudo nix run --extra-experimental-features 'nix-command flakes' github:dustinlyons/nixos-config#installWithSecrets I do get an error where the installer doesn't find "/dev/%DISK%" of course I do not get to a point where I may issue "bin/apply

dustinlyons commented 1 year ago

Okay, sorry about that. I was confusing myself with the Mac installation. The bin/apply actually runs as part of the installWithSecrets nix-command. But that was broken now that the %DISK% token was introduced, so I just released a patch. To test, I'm currently building a new VM by just running

sudo nix run --extra-experimental-features 'nix-command flakes' github:dustinlyons/nixos-config#install

So can you try again?

TonyBostonTB commented 1 year ago

Cool! Moving forward with this. Now the next issue is that, if running the setup with keys, one would not have a chance to set an own github repo for nix-secrets. It's always trying to use your own repo.

As a sidenote: As far as I understand, you'll have to put your SSH Keys in the ROOT USers $HOME as you running sudo iwht the install command, correct?

dustinlyons commented 1 year ago

Yes, check out these steps here: https://github.com/dustinlyons/nixos-config#2-optional-setup-secrets

To use secrets, you need to have created this repo beforehand. The repo can be empty just needs to exist.

There are helper commands that give you a few options to bring your keys in. Let me know if you need any clarification on the README steps.

TonyBostonTB commented 1 year ago

Sure I did that setup and brought my own keys, but if I run the install command, it tries to use your repo for the secrets

error: unable to download https://api.github.com/repos/dustinlyons/nix-secrets/commits/main*: HTTP errar
• 404
response body:
"message": "Not Found"
"documentation_url": "https://docs.github.com/rest/commits/commits#get-a-commit"
(use
*--show-trace' to show detailed location information)
configuration file /mnt/etc/nixos/configuration.nix doesn't exist
dustinlyons commented 1 year ago

Oh, understood! Let me patch that shortly :) I'll add that to the installation.

TonyBostonTB commented 1 year ago

Maybe asking for the correct repo in the setup would be sufficient

dustinlyons commented 1 year ago

Yeah, then I can just sed/replace another token as part of install before using the flake. I can get it out within the next couple hours, gotta do some work stuff first.

dustinlyons commented 1 year ago

Can you try now?

TonyBostonTB commented 1 year ago

Awesome. Installation went fine. Only thing after reboot, my user password didn't work. Had to set it again with the root user. And thanks for the quick support here, much appreciated!

dustinlyons commented 1 year ago

@TonyBostonTB Awesome, great to hear! Yeah, when you enter your password during installation that's actually for root. User pass isn't set during installation. I need to find a proper way to either have a default password or let the user set it.

What else would be helpful for first-time usage? Anything you're finding confusing/hard to use?

I probably need to add the default key bindings to the README and how to change them.

TonyBostonTB commented 1 year ago

Actually after the first reboot, nothing really works. I get a huge segfault list with failed files and did stop for now to further investigate. :( If somebody is interested, I might install again and get to all the errors in a new issue.

dustinlyons commented 1 year ago

Oh wow, okay. I've got it running on a VM and an x86 machine w/ UEFI at home, and this should be very reproducible, the whole point of Nix :). So something is going on. I'd love to see the errors you're getting if you have the time. Thanks for all the input so far.