nixos/README.md
Ivan Bushchik c5cfec0c98
README.md: add comments for rubusidaeus
Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
2023-08-31 18:51:25 +03:00

1.7 KiB

NixOS Configuration files.

Deploying

Setup disks, mount root to /mnt and /boot to /mnt/boot and run something like this

git clone https://github.com/ivabus/nixos /mnt/etc/nixos
nixos-generate-config --show-hardware-config --root /mnt > /mnt/etc/nixos/machines/host/hardware.nix
nixos-install --flake path:.#host

Raspberry Pi image generation

Replace {{REPO_PATH}} with path to this repo (surprising, isn't it) and run on NixOS system (or system with Nix (don't tested))

nix build path:{{REPO_PATH}}#nixosConfigurations.rubusidaeus.config.system.build.sdImage

Rebuilding

nixos-rebuild switch --flake path:/etc/nixos

Apple Silicon hosts require additional --impure flag for firmware installation. (Firmware should be placed in /etc/nixos/asahi/firmware (ignored by git)).

Hosts configured

  • stella (Random Ryzen 3 3250U laptop)
  • vetus (iMac 27" 2017)
  • celerrime (MacBook Air M2)
  • rubusidaeus (Raspberry Pi 4B)

Modules

Module example:

{ config, lib, ... }:

let
    cfg = config.my.MODULE;
in {
  options.my.MODULE.enable = lib.mkEnableOption "Enable MODULE";
  config = lib.mkIf (cfg.enable) {
    MODULE_CONFIGURATION
  };
}

Shells

I "made" some shell in shells/.

Dotfiles (from ivabus/dotfiles)

I install my dotfiles with prepared script

curl https://iva.bz/nix | sh

TODO

  • Setup services (which I host)
  • Setup "secret" roles (I need them)
  • Setup router

This configuration is MIT licensed.

I used delroth/infra.delroth.net (MIT license) as a reference for my configuration.