1
1
Fork 0
NixOS Configuration
Find a file
Myned d73715998a
myne: update nixos config
Signed-off-by: Myned <dev@bjork.tech>
2024-10-08 21:30:49 -05:00
machines myne: update nixos config 2024-10-08 21:30:49 -05:00
options containers: rename sevices to arion-* 2024-10-08 18:23:50 -05:00
profiles nix: move settings.containers to top-level custom 2024-10-06 10:16:52 -05:00
secrets myne: update nixos config 2024-10-08 21:30:49 -05:00
.gitignore git: migrate to forgejo 2024-09-12 19:41:21 -05:00
configuration.nix nix: fix incompatible adw-gtk3 version 2024-10-01 19:35:47 -05:00
flake.in.nix nix: fix formatting 2024-10-06 10:14:20 -05:00
flake.lock nix: update flake.lock 2024-10-06 10:17:03 -05:00
flake.nix nix: update hyprland to v0.44.0 2024-10-06 10:14:03 -05:00
LICENSE git: migrate to forgejo 2024-09-12 19:41:21 -05:00
README.md chore: update readme 2024-10-08 21:28:14 -05:00

WARNING

This configuration is not meant for public usage

Install

Remote (with NixOS Anywhere)

  1. Clone this repository
git clone https://github.com/myned/nixos
  1. Enable Flakes

  2. Boot from NixOS minimal installer

  3. Create machine-specific modules in machines/MACHINE/

a. Machine configuration and hostname in default.nix

{ custom.hostname = "MACHINE"; }

b. 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"

c. Generated hardware configuration in hardware-configuration.nix

nixos-generate-config --show-hardware-config --no-filesystems --root /mnt
  1. Choose profile and add machine-specific modules to flake.in.nix
MACHINE = BRANCH "ARCHITECTURE" [ ./profiles/PROFILE ./machines/MACHINE ];
  1. Generate and lock flake.nix with flakegen
cd nixos
git add .
nix run .#genflake flake.nix
nix flake lock
  1. Generate machine SSH key and rekey agenix secrets with added public key
mkdir -p tmp/etc/ssh/
ssh-keygen -f tmp/etc/ssh/id_ed25519 -N '' -C root@MACHINE
cd secrets
agenix -r
  1. Add user SSH key to root authorized_keys on machine
# On host
cat ~/.ssh/id_ed25519.pub | wl-copy
# On machine
sudo mkdir /root/.ssh/
sudo nano /root/.ssh/authorized_keys
  1. Execute NixOS Anywhere
nixos-anywhere --extra-files tmp --flake .#MACHINE root@IP
  1. Shutdown, detach ISO, and reboot

  2. Remove temporary files

rm -r tmp