NixOS Configuration
|
||
---|---|---|
machines | ||
options | ||
profiles | ||
secrets | ||
.gitignore | ||
configuration.nix | ||
flake.in.nix | ||
flake.lock | ||
flake.nix | ||
LICENSE | ||
README.md |
WARNING
This configuration is not meant for public usage
Install
Remote (with NixOS Anywhere)
-
Clone this repository
git clone https://github.com/Myned/nixos
-
Enable Flakes
-
Boot from NixOS minimal installer
-
Create machine-specific modules in
machines/MACHINE/
b. Machine configuration and hostname in
default.nix
{ custom.hostname = "MACHINE"; }
c. Disko layout in
disko.nix
# Verify /dev identifier on machine lsblk # Verify EFI/BIOS firmware on machine [ -d /sys/firmware/efi/efivars ] && echo "UEFI" || echo "BIOS"
d. Generated hardware configuration in
hardware-configuration.nix
nixos-generate-config --show-hardware-config --no-filesystems --root /mnt
-
Choose profile and add machine-specific modules to
flake.in.nix
MACHINE = BRANCH [ ./profiles/PROFILE ./machines/MACHINE ];
-
Generate
flake.nix
with flakegengit add . nix run .#genflake flake.nix nix flake lock
-
Copy host public SSH key to root on machine
# On machine sudo passwd root
# On host ssh-copy-id root@MACHINE
-
Test and execute NixOS Anywhere
nixos-anywhere --vm-test -f .#MACHINE root@IP nixos-anywhere -f .#MACHINE root@IP
-
Shutdown, detach ISO, and reboot