flake#
The configuration files for all of my personal Nix based systems.
Usage#
To setup a system with one of the hosts on the system use nixos-rebuild.
$ nixos-rebuild boot --flake $PWD#hostname
If you are on a darwin system however, you need to use darwin-rebuild.
$ darwin-rebuild switch --flake $PWD#hostname
Adding hosts and users#
To add a new host you will want to create a config in hosts and add it.
mkSystem "hostname" {
user = "username";
system = "x86_64-linux";
profile = "nixos";
}
For users, simply add a configuration to the users directory, it uses hjem.
darwin.nix- the user configuration specifically for darwin systems.nixos.nix- the user configuration specifically for nixos systems.
You can look at existing users and hosts to see how they are setup.
Structure#
My flake is structured in a way that is focused on being easy to maintain.
flake/
├── hosts/
│ └── <name>/
│ ├── system/
│ ├── services/
│ └── default.nix
├── lib/
│ └── mksystem.nix
├── users/
│ └── <name>/
│ ├── configs/
│ ├── darwin.nix
│ └── nixos.nix
├── flake.lock
└── flake.nix