Note
I'm archiving this again, as I'm distro hopping to Fedora Silverblue instead. I feel like that should fit me pretty well, as I like the idea of immutability in the base system then using separate containers for each project I'm working on to keep things neat and separate. I'm also one of those weird people who appreciate the sandboxing of Flatpak apps. I obviously already had essentially that same setup through this config, but I think I want something more hands-off.
This is my personal NixOS configuration, with the main goal of having a unified system install and configuration between my desktop and laptop.
- Dentritic aspect-oriented structure thanks to den
- Automatic recursive imports with import-tree
- Auto-generated flake.nix using flake-file
- Modularized with flake-parts
- Declarative disk partitioning using disko
- tmpfs root file system through impermanence
- Declarative Flatpak management with nix-flatpak
- https://codeberg.org/Adda/nixos-config
- https://github.com/augustocdias/dotfiles
- https://github.com/henriquekirchheck/nixos-flake
These are just personal notes because I tend to forget these things.
Using nixos-anywhere to push the configuration for installation over SSH.
- Boot a NixOS ISO (other systems are supported too, but untested by me).
- Create a new file under
modules/hosts/for the new host, taking "inspiration" from one of those already there. - Run
nixos-generate-config --no-filesystems --show-hardware-configon the new machine, and add those options to the host configuration. - Create an appropriate
disko.devicesdefinition, see examples. - Run the installation:
nix run github:nix-community/nixos-anywhere -- --flake .#<hostname> --target-host nixos@<ip address>- Profit. Wait for it to finish and reboot.
It's possible to pass either remote or local as a --build-on option to nixos-anywhere, which could be nice
depending on which machine is faster or has a better connection.