1
0
Fork 0
Reproducible localhost based on NixOS
 
 
 
Go to file
dump_stack() 7e4383aa89
to not affect local development, remove system-wide out-of-tree
2023-02-13 09:16:09 +00:00
etc rofi config 2023-02-13 09:11:44 +00:00
.gitignore Add local.nix 2022-12-17 17:47:08 +00:00
LICENSE Initial 2019-05-31 00:08:17 +00:00
README.md Use the latest kernel by default 2023-02-13 09:07:36 +00:00
auto-update.nix Faultless auto-update 2020-12-14 18:19:16 +00:00
configuration.nix Change state to 22.11 2023-02-13 09:07:48 +00:00
desktop.nix xmodmap on hotplug 2023-02-13 09:08:11 +00:00
hacks.nix Implements docker-based fhs env wrapper 2019-07-05 19:49:51 +00:00
home-manager.nix add tmpfs symlinks for google-chrome 2023-02-13 09:12:05 +00:00
local.nix.example Add local.nix 2022-12-17 17:47:08 +00:00
networking.nix OpenVPN keep-alive service 2022-05-11 14:23:27 +00:00
packages.nix Add rofi-bluetooth 2023-02-13 09:13:03 +00:00
secrets.nix.example Add hosts 2021-05-18 13:20:23 +00:00
security.nix to not affect local development, remove system-wide out-of-tree 2023-02-13 09:16:09 +00:00
suspend.nix Initial 2019-05-31 00:08:17 +00:00
thinkpad.nix CPU Throttling Fix 2019-08-22 22:11:33 +00:00
wireless-networks.nix.example Add wireless networks sample 2019-06-21 19:16:58 +00:00

README.md

Fully reproducible localhost

Download NixOS installation ISO

Notes:

  1. I assume that latest stable (e.g. 22.11) ISO will be used for installation.
  2. 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 from networking.nix) and remove services.openvpn.servers.vpn from networking.nix.
  3. 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

cp local.nix.example local.nix

nix-channel --add https://nixos.org/channels/nixos-22.11 nixos
nix-channel --add https://nixos.org/channels/nixos-unstable unstable
nix-channel --update

nixos-generate-config --root /mnt

nixos-install
reboot

After install

Initial password for user is user.

sudo nix-channel --add https://nixos.org/channels/nixos-22.11 nixos
sudo nix-channel --add https://nixos.org/channels/nixos-unstable unstable
sudo nix-channel --update