Reproducible localhost based on NixOS
|
||
---|---|---|
etc | ||
.gitignore | ||
configuration.nix | ||
desktop.nix | ||
docker.nix | ||
hacks.nix | ||
home-manager.nix | ||
LICENSE | ||
networking.nix | ||
packages.nix | ||
README.md | ||
secrets.nix.example | ||
security.nix | ||
suspend.nix | ||
thinkpad.nix | ||
wireless-networks.nix.example |
Fully reproducible localhost
Download NixOS installation ISO
Notes:
- I assume that latest stable (e.g. 19.03) ISO will be used for installation.
- Check
services.xserver.videoDrivers
indesktop.nix
. If you not sure it's better to remove the line completely. - Default network configuration is VPN-only, so if you don't have plans to use it you need to change iptables rules (remove
iptables -P OUTPUT DROP
fromnetworking.nix
) and removeservices.openvpn.servers.vpn
fromnetworking.nix
. - GUI settings is optimized for 3840x2160 on 15".
Installation
parted /dev/vda mklabel gpt
parted /dev/vda mkpart EFI fat32 0% 512M
parted /dev/vda set 1 esp on
parted /dev/vda mkpart NIX ext4 512M 100%
cryptsetup luksFormat /dev/vda2
cryptsetup open /dev/vda2 nix
mkfs.vfat -F32 /dev/vda1
mkfs.ext4 /dev/mapper/nix
mount /dev/mapper/nix /mnt/
mkdir /mnt/boot
mount /dev/vda1 /mnt/boot
nix-env -iA nixos.gitMinimal
git clone https://code.dumpstack.io/infra/localhost.git /mnt/etc/nixos/
cd /mnt/etc/nixos
cp wireless-networks.nix.example wireless-networks.nix
nano wireless-networks.nix
cp secrets.nix.example secrets.nix
nano secrets.nix
nix-channel --add https://nixos.org/channels/nixos-unstable unstable
nix-channel --update
nixos-generate-config --root /mnt
nixos-install
reboot
After install
Initial user password for is user
.
sudo nix-channel --add https://nixos.org/channels/nixos-unstable unstable