nixos/README.md

51 lines
1.9 KiB
Markdown
Raw Normal View History

2021-11-15 17:43:04 +01:00
# nixos
2021-11-29 10:55:16 +01:00
This repository contains my configuration for my Nixos systems.
I don't provide any garantuees that it will work on other systems.
In addition some of the scripts required for installation will destroy your data when used.
2022-01-25 18:19:00 +01:00
## VM installation
This allows you to setup a VM with minimal effort.
However this requires some prerequisites.
- A VM running the minimal NixOS ISO reachable with SSH under nixos@nixos.2li.local.
- The VM runs UEFI.
2022-01-25 18:33:13 +01:00
- You've set a password for the nixos user.
2022-01-25 18:19:00 +01:00
2022-09-16 12:47:10 +02:00
1. `./scripts/install_new_vm.sh`
2022-01-25 18:19:00 +01:00
2. Provide the required information and wait until the script is finished.
3. Reboot and profit!
2022-09-06 19:43:47 +02:00
## Raspberry Pi installation
2022-09-06 21:46:25 +02:00
1. Download the image from: https://hydra.nixos.org/job/nixos/release-22.05/nixos.sd_image.aarch64-linux
2022-09-06 19:43:47 +02:00
2. Extract it with: `unzstd nixos-sd-image-*-aarch64-linux.img.zst`
2022-09-07 22:05:53 +02:00
3. Flash it to the SD card with `sudo dd if=$(ls
nixos-sd-image-*-aarch64-linux.img) of=/dev/mmcblk0 bs=4M`
4. After booting create a password for the `nixos` user.
5. SSH into the system.
6. `curl https://git.2li.ch/Nebucatnetzer/nixos/archive/master.tar.gz | tar xz`
7. `sudo cp nixos/systems/raspi4/init_config.nix /etc/nixos/configuration.nix`
8. `sudo nixos-rebuild switch`
9. Mount the `FIRMWARE` partition `sudo mount /dev/disk/by-label/FIRMWARE /mnt`
and make sure that your `config.txt` looks like [./systems/raspi4/config.txt](./systems/raspi4/config.txt)
2022-09-16 12:47:10 +02:00
10. Install the system `./scripts/install_new_system.sh`
2022-09-06 19:43:47 +02:00
## x86 installation
2021-11-20 16:30:25 +01:00
1. `curl https://git.2li.ch/Nebucatnetzer/nixos/archive/master.tar.gz | tar xz`
2022-01-24 19:06:51 +01:00
2. `cd nixos && nix-shell`
3. `sudo python3 scripts/format-disk.py`
2022-01-24 17:22:13 +01:00
4. `sudo nixos-install --no-root-passwd --root /mnt --impure --flake .#SYSTEMNAME`
2021-11-29 10:55:16 +01:00
2022-01-17 11:23:55 +01:00
## Update remote systems
Simply run the script `scripts/update_all_systems.xsh` and it will iterate over
all defined systems.
The script requires Xonsh but can be easily adapted to BASH or similar.
2021-11-29 10:55:16 +01:00
## Non-Nixos System
2022-01-25 18:19:00 +01:00
1. `scripts/install-home-manager.sh`