Open llakala opened 4 months ago
After doing some research in the nixos-anywhere how-to guide, the ideal setup seems to be:
If you weren't doing it with nixos-anywhere, what would be your approach to minimize manual activity when installing a new device afresh?
Create an ISO (based on nixos-minimal) with configuration on board, boot the laptop with it and run sudo nixos-install
?
P.S.: Love the relatively simple structure of your setup. :heart_eyes:
If you weren't doing it with nixos-anywhere, what would be your approach to minimize manual activity when installing a new device afresh?
Create an ISO (based on nixos-minimal) with configuration on board, boot the laptop with it and run
sudo nixos-install
?P.S.: Love the relatively simple structure of your setup. :heart_eyes:
I've been heavily procrastinating on setting up a better ISO install. This is what I've attempted to do with little luck. The thing that seems to slow me down is hardware configuration. Keep in mind it's been several months since I worked on this.
On a fresh install, I end up having to do tons of things manually, mainly surrounding filesystems. Since a fresh install will use UUIDS for disk partitions, I always have to do generate-config for the hardware, move the file to the right place, etc. It's hell.
I'd far prefer to use something like Disko. However, I was running out of RAM last time I tried disko-install. I think the problem is that /tmp was mounted as a tmpfs, and I couldn't rebuild to fix that without it filling up. I probably just need to build the iso without that enabled.
Honestly, if I was setting this up, I'd try going around Disko, and setting up a shell script where I use part LABELS for the partitions rather than UUIDS. The issue I'd probably encounter is generating hardware-configuration.nix
to use these automatically. This wiki page may be a good reference.
On a fresh install, I end up having to do tons of things manually, mainly surrounding filesystems. Since a fresh install will use UUIDS for disk partitions, I always have to do generate-config for the hardware, move the file to the right place, etc. It's hell.
Agreed, that's the problem I'm looking to get solved, too. The UUID vs. label problem with Disko should be possible to solve. IIUC, it's not difficult to instruct Disko to use labels for the partitions via extraArgs
to inject the -L
option, e.g.
extraArgs = [ "-LmyLabel" ];
See https://github.com/nix-community/disko/issues/515 for reference.
Re nixos-generate-config
, I still need to understand the role of NixOS/nixos-hardware. My guess is, it should be possible to simply refer to one of those pregenerated configurations, which solves the problem of having to go into the machine first to generate the configuration and copy it to your setup (provided you don't have custom hardware, obviously).
disko-install is good, but it's just as annoying as the basic ISO. Ideally, there would be a system that is painless and just work. I'm not sure if that exists. Maybe that's just declaring the iso as a host, maybe that's nixos-anywhere, maybe that's nixos-generators. Research is required.
Goals: