nixos/README.md

54 lines
1.5 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-09-06 19:43:47 +02:00
## Raspberry Pi installation
2022-11-05 20:30:59 +01:00
1. Add the new system to `flake.nix`.
2022-11-09 22:14:07 +01:00
2. Build the image with `scripts/build-raspi-image.sh SYSTEMNAME`
3. Flash the image to an SD card
`dd if=~/Downloads/SYSTEMNAME.img of=/dev/mmcblk0 bs=4M`.
2023-05-27 17:51:15 +02:00
4. After you've booted the Pi get the new SSH key with
`ssh-keyscan hostname.custom.domain` and add it to `scrts/secrets.nix`.
2022-11-09 22:14:07 +01:00
5. Then login into the new Pi and mount the `FIRMWARE` partition with
2022-11-12 01:42:16 +01:00
`sudo mkdir -p /mnt && 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-11-16 22:23:14 +01:00
6. Change the password
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`
2023-07-22 14:33:00 +02:00
3. `sudo ./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
2023-07-22 14:33:00 +02:00
Simply run the script `scripts/remote_switch.sh` and it will iterate over
all defined systems. With the option `-r` the systems will reboot as well.
2022-01-17 11:23:55 +01:00
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`
2023-05-27 17:51:15 +02:00
## Development
### Options template
```nix
{ config, lib, pkgs, ... }:
let
cfg = config.programs.NAME;
in
{
options = {
programs.NAME.enable = lib.mkEnableOption "DESCRIPTION";
};
config = lib.mkIf cfg.enable {
};
}
```