diff --git a/.env_sample b/hosts/.env_sample similarity index 100% rename from .env_sample rename to hosts/.env_sample diff --git a/makefile b/hosts/makefile similarity index 99% rename from makefile rename to hosts/makefile index a7b78e4..0a25774 100644 --- a/makefile +++ b/hosts/makefile @@ -7,7 +7,7 @@ ifneq ($(REQUIRED_V),$(firstword $(sort $(MAKE_VERSION) $(REQUIRED_V)))) endif .PHONY: format \ - partitios + partition \ configure_boot \ configure_luks \ configure_lvm \ @@ -95,6 +95,7 @@ mount: mount /dev/disk/by-partlabel/boot /mnt/boot nix_install: + cd .. nixos-generate-config --root /mnt cp -i nixos/* /mnt/etc/nixos/ nixos-install diff --git a/hosts/readme.md b/hosts/readme.md new file mode 100644 index 0000000..b35bc4c --- /dev/null +++ b/hosts/readme.md @@ -0,0 +1,43 @@ +# What's this? + +This directory contains the specific host configuration for each machine that uses this nix setup. Description and hardware of each machine will be listed as a comment block at the start of each `.nix` file. + +# So you want to add a machine? + +This will get flushed out as a move more of my systems over to NixOS. + +## Setup + +`cp .env_sample .env` + +Update the variables. run `make echo` to verify all values are set correctly. + +If all looks good run `make install`. This will + +1. Wipe the specified drive. +2. Partition the drive using `gdisk` +3. Setup the boot drive +4. Configure the LUKS partition +5. Setup the LVM inside the LUKS Partition +6. Setup Swap inside the LVM. +7. Setup a ZFS pool & create ZFS mount points +8. Generate then install the NixOS configuration. + +Note: Step 8 is now outdated and should be updated to work with this configuration format and flakes. + +This should leave you with a system formatted like the below + +``` +NAME TYPE MOUNTPOINT +nvme0n1 disk +├─nvme0n1p1 part /boot +└─nvme0n1p2 part + └─crypt crypt /dev/mapper/root + └─partitions lvm + ├─swap swap /dev/partitions/swap + └─lvm_root lvm /dev/partitions/lvm_root + └─rpool zpool + ├─rpool/root zfs + ├─rpool/root/nixos zfs / + └─rpool/home zfs /home +```