[Nix-dev] disk setup for nixos installation

Tim Barbour trb at categorical.net
Sat Aug 17 15:22:14 CEST 2013


I would like to be able to boot from nixos installation media, then do
automated partitioning, LVM setup and filesystem creation, then let nixops do
the rest. What is the best way to automate partitioning, LVM setup and
filesystem creation ? I wrote a shell script to do this (just for one disk, so
far) using parted etc., but it looks ugly, and I wonder if it would be better
done using nix.

Does nix / nixos provide any existing mechanisms for doing this ?

I am an experienced functional programmer (Haskell, not nix), but I don't
understand how to do IO in nix. Perhaps I should be modelling the disk setup
as the building of some derivations, but such derivations would not produce a
result in the nix store.  If I made them produce a result in the store, then
the disk setup would be a side-effect, and not referentially transparent. I
get the feeling that this is outside the scope of nix.

Tim
---
GPG public key available at: 
	 http://phasechangeit.com/~trb/gpg-key  or 
	 http://subkeys.pgp.net:11371


More information about the nix-dev mailing list