My NixOS configuration
Generating a list of paths for restic to backup introduces some issues: - restic matches incremental backups by paths, changing paths cause new backups - logs and a lot of restic commands print all the paths, which makes it basically unusable Thus I've reverted to using static `paths` and excluding patterns via the `--exclude-file` argument. To reduce files to backup from `~/dev`, a preStart job was added to the systemd service: It clones the directory via `rsync` with `.gitignore` files being respected. |
||
|---|---|---|
| desktop | ||
| hardware | ||
| home | ||
| lib | ||
| modules | ||
| pkgs/deconz | ||
| scripts | ||
| secrets | ||
| services | ||
| system | ||
| templates | ||
| virtualisation | ||
| .editorconfig | ||
| .env.example | ||
| .envrc | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| flake.lock | ||
| flake.nix | ||
| home-pc.nix | ||
| home-server.nix | ||
| LICENSE | ||
| README.md | ||
| work-pc.nix | ||
felschr's NixOS configuration
Installation
Clone the configuration into /etc/nixos.
On a new machine run:
scripts/setup-partitions
Then move the resulting /etc/nixos/hardware-configuration.nix to ./hardware/<config>.nix.
Update the configuration according to the script output, if necessary. Btrfs mount options likely need to be added, for example.
Reference this hardware config in a nixosConfigurations.<config> section in flake.nix.
To install run the following command where <config> matches outputs.nixosConfigurations.<config> in flake.nix:
nixos-install --flake '/etc/nixos#<config>'
Updating
Update all flake inputs:
nix flake update
Update a specific flake input:
nix flake lock --update-input <input>
Rebuilding the system
Rebuild the system:
sudo nixos-rebuild switch
Rebuild the system for a remote machine:
sudo nixos-rebuild switch --flake '/etc/nixos#<config>' --target-host user@hostname --use-remote-sudo