1
1
Fork 0
NixOS Configuration
Find a file
Myned ab485dec35
nix: format with alejandra
Signed-off-by: Myned <dev@bjork.tech>
2024-09-12 20:50:53 -05:00
machines nix: format with alejandra 2024-09-12 20:50:53 -05:00
options nix: format with alejandra 2024-09-12 20:50:53 -05:00
profiles nix: format with alejandra 2024-09-12 20:50:53 -05:00
secrets nix: format with alejandra 2024-09-12 20:50:53 -05:00
.gitignore git: migrate to forgejo 2024-09-12 19:41:21 -05:00
configuration.nix nix: format with alejandra 2024-09-12 20:50:53 -05:00
flake.in.nix nix: change nixpkgs-local dir 2024-09-12 20:15:20 -05:00
flake.lock nix: update flake.lock 2024-09-12 19:41:21 -05:00
flake.nix nix: format with alejandra 2024-09-12 20:50:53 -05:00
LICENSE git: migrate to forgejo 2024-09-12 19:41:21 -05:00
README.md nixos: remove support for script install 2024-09-12 19:41:21 -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
    
  2. Enable Flakes

  3. Boot from NixOS minimal installer

  4. 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
    
  5. Choose profile and add machine-specific modules to flake.in.nix

    MACHINE = BRANCH [ ./profiles/PROFILE ./machines/MACHINE ];
    
  6. Generate flake.nix with flakegen

    git add .
    nix run .#genflake flake.nix
    nix flake lock
    
  7. Copy host public SSH key to root on machine

    # On machine
    sudo passwd root
    
    # On host
    ssh-copy-id root@MACHINE
    
  8. Test and execute NixOS Anywhere

    nixos-anywhere --vm-test -f .#MACHINE root@IP
    nixos-anywhere -f .#MACHINE root@IP
    
  9. Shutdown, detach ISO, and reboot