53 lines
2.9 KiB
Markdown
53 lines
2.9 KiB
Markdown
# NixOS configuration
|
|
|
|
Nix flake configuration for NixOS hosts with host-specific modules and Home Manager integration. The declared targets are `dev-vm`, `alex-laptop`, and `alex-desktop`; the flake pins NixOS and Home Manager release 25.05.
|
|
|
|
## Prerequisites
|
|
|
|
- NixOS with `nixos-rebuild` available.
|
|
- A local hostname that exactly matches one of the declared flake configuration names when using `rebuild.sh`.
|
|
- Hardware configuration and storage settings appropriate to the machine being configured.
|
|
|
|
The shared system module enables the `nix-command` and `flakes` experimental features. It also enables services and system settings, so evaluating or switching this configuration is not equivalent to applying a user-only dotfile setup.
|
|
|
|
## Hosts and configuration
|
|
|
|
- `dev-vm` — VirtualBox guest-oriented configuration.
|
|
- `alex-laptop` — laptop-specific modules, hardware configuration, power behaviour, and Home Manager user configuration.
|
|
- `alex-desktop` — desktop-specific hardware, graphics, boot, storage, and user configuration.
|
|
|
|
Host modules contain machine-specific hardware and storage references. Do not copy them to another machine without reviewing and replacing the applicable hardware configuration and boot/storage settings. Keep any secrets or host-specific values outside documentation and review the checked-in configuration before use.
|
|
|
|
## Apply a configuration
|
|
|
|
> **Warning: system-wide operation.** `switch` builds and activates a NixOS system configuration with root privileges. It can change boot, storage, services, users, networking, and desktop behaviour on the current machine.
|
|
|
|
The supplied helper is:
|
|
|
|
```sh
|
|
./rebuild.sh
|
|
```
|
|
|
|
It executes:
|
|
|
|
```sh
|
|
sudo nixos-rebuild switch --flake .#$(hostname)
|
|
```
|
|
|
|
Run it from the repository root only after confirming that `hostname` selects the intended declared host. No repository-provided bootstrap, hardware-installation, rollback, test, or `flake check` workflow is defined; use only procedures appropriate to the target system and retain a known-good boot generation before switching.
|
|
|
|
## Validation status
|
|
|
|
No test suite or flake `checks` definitions were found. Nix was unavailable during the documentation audit, so the flake was not evaluated or built.
|
|
|
|
There are known static configuration gaps that must be resolved before relying on all targets: `dev-vm` refers to paths that are absent from the repository (`./common.nix` at the flake root and `modules/sway.nix`/`modules/dev.nix` relative to its host module), and the laptop module refers to an absent `thermald-conf.xml`. These findings are static and have not been confirmed by Nix evaluation.
|
|
|
|
## Repository layout
|
|
|
|
- `flake.nix` and `flake.lock` — flake inputs and named NixOS configurations.
|
|
- `rebuild.sh` — hostname-based `nixos-rebuild switch` helper.
|
|
- `system/` — shared system configuration and modules.
|
|
- `hosts/` — host-specific NixOS, hardware, and user modules.
|
|
- `hardware/` — hardware-related modules.
|
|
- `user/` — shared Home Manager configuration.
|