Partition with
sudo -E `which nix` --extra-experimental-features 'nix-command flakes' run -vL github:nix-community/disko/latest -- --flake .#nixluon --mode destroy,format,mount
Install with
sudo -E `which nix` --extra-experimental-features 'nix-command flakes' run -vL github:nix-community/disko/latest#disko-install -- --flake .#nixluon --disk main <path/to/disk>
Build with
nice -n 19 ionice -c 3 nix build .#nixosConfigurations.$(hostname).config.system.build.toplevel
Update with
sudo nice -n 19 ionice -c 3 nixos-rebuild switch --flake .
disko-install
may fail with
setting up /etc...
/nix/var/nix/profiles/system/sw/bin/bash: line 10: mount: command not found
disko-install failed
particularly if you're not already on NixOS. There's a Discourse thread about the problem.
TL;DR:
# mount the (existing) system via just disko
sudo -E `which nix` --extra-experimental-features 'nix-command flakes' run -vL github:nix-community/disko/latest -- --flake .#nixluon --mode mount
# run disko-install in dry run mode to get the system path
sudo -E `which nix` --extra-experimental-features 'nix-command flakes' run -vL github:nix-community/disko/latest#disko-install -- --flake .#nixluon --disk main /dev/sda --dry-run
# grab a nixos-install via comma
, -s nixos-install
# remember where it is
which nixos-install
# go superuser (sudo alone won't work, nix-env won't be found)
sudo su -
# fix path
export PATH="$PATH:/nix/var/nix/profiles/system/sw/bin"
# install (see previous steps for the paths)
<path/to/nixos-install> --system <path/to/system> --root '/mnt/'