News for hackers. Stuff that matters.
Re:Setting up my new laptop: Nix style by the_duke on Saturday December 24, 2022 @07:20PM (#34122685)
I switched to NixOS two years ago , and have installed it on about 6 personal machines, both latpops and desktops.

I don't bother with building a custom ISO.

The way I do it:

* Boot with the default ISO

* Format the disk

* Git clone my dotfiles repo with all the configs

* Generate the hardware config and extend my flake.nix with the new machine.

* Install with my dotfiles config

* Reboot (aka profit!)

I can complete the whole process in about 10 minutes (on a fast CPU and with a good network).

Customizing the config up front, building the custom ISO , and writing it to a USB stick takes up way more time than just doing the above.

Re:Setting up my new laptop: Nix style by infogulch on Saturday December 24, 2022 @10:31PM (#34123919)
I guess ISOs are more useful if you're commissioning a fleet of identical machines.
Re:Setting up my new laptop: Nix style by anon291 on Sunday December 25, 2022 @12:17AM (#34124514)
I don't even do that. My workflow is really easy.

1. Use netboot.xyz to boot Nixos 2. Copy over nix configurations. I use nix flakes, so I can pre-build all my packages on another machine and debug the config in a more comfortable environment. 3. Run nixos-install (and generate a hardware config if needed). 4. Reboot

Re:Setting up my new laptop: Nix style by bmcgee84 on Sunday December 25, 2022 @07:28AM (#34126659)
Nothing wrong with the workflow you described, done much the same in the past myself.
Re:Setting up my new laptop: Nix style by abrouwers on Sunday December 25, 2022 @12:58PM (#34129406)
Out of curiosity, how often do you "set things up from scratch?". It's such a rare thing for me, that usually dumping my list of installed packages / installing those, and then bringing in modified configs, is way less work than learning something as complex as Nix.
Re:Setting up my new laptop: Nix style by indemnity on Sunday December 25, 2022 @08:30PM (#34133553)
I'm trying to get something like this, but here's my situation:

- I have two M1 Macs, running MacOS

- I have a Ryzen desktop that dual-boots Windows 11 and NixOS 22.11

I would like to have one dotfiles repo with all my configs and home-manager setup, as well as the system / hardware config for the bare-metal NixOS installations.

I have gotten these working independently, but I still can't quite make the leap in a single repo to:

- Having some config be machine-specific

- Having other config be OS-specific

- On a particular machine (same OS - macOS), having some slightly different config, because it's a work machine vs personal (e.g. different .gitconfig setups).

Can all of the above be addressed with Nix?

There seems to be an assumption either you have gone all-in using NixOS (e.g. in a VM inside host OS, or bare-metal), or you are just using the package manager (+ a subset of home-manager), e.g. macOS or WSL inside Windows.

But on the whole, 80% of what I want to set up and configure is machine-agnostic (NeoVIM, fish shell, basic CLI utilities, etc), and I use direnv/shell.nix in individual project folders to load the tooling for that project.

Re:Setting up my new laptop: Nix style by nalllar on Sunday December 25, 2022 @09:25PM (#34133876)
You want to split your config up into separate .nix files, with common parts living separately from machine specific parts.

Then you can have multiple system and home configs that import the common files and then add your own config.

You can also pass options in with suecialArgs / extraSpecialArgs to the nixos/hm modiles.