This repository holds my Nix configurations. It uses the nixos-unified framework for consistent configuration across NixOS, nix-darwin, and home-manager.
For the configurations' entry points, see the individual configurations, as well as flake.nix. For adding overlays see overlays.
Hostnames are picked from my hostname list.
.
├── configurations/ # Host-specific configurations
│ ├── nixos/ # NixOS hosts
│ ├── darwin/ # nix-darwin hosts
│ └── home/ # Standalone home-manager hosts
├── modules/ # Reusable modules
│ ├── nixos/ # NixOS-only modules
│ ├── darwin/ # Darwin-only modules
│ ├── home/ # Shared home-manager modules
│ ├── shared/ # Shared NixOS+Darwin modules
│ └── flake-parts/ # Flake-level configuration
├── overlays/ # Nixpkgs overlays
└── secrets/ # Encrypted secrets (agenix-rekey)
The unified activate command works for all configuration types:
$ nix run .#activateThis auto-detects your hostname and activates the appropriate configuration.
NixOS:
$ sudo nixos-rebuild --flake .#<hostname> switchDarwin:
$ darwin-rebuild --flake .#<hostname> switchHome Manager:
$ home-manager --flake .#<hostname> switchTo update the primary flake inputs (nixpkgs, home-manager, nix-darwin):
$ nix run .#updateOverlays should be added as individual nix files to ./overlays/ with format:
final: prev: {
hello = prev.hello.overrideAttrs (oldAttrs: { doCheck = false; });
}For more examples see overlays.
- nixosModules.* - NixOS-only modules from
modules/nixos/ - darwinModules.* - Darwin-only modules from
modules/darwin/ - homeModules.* - Shared home-manager modules from
modules/home/
Modules are imported via flake outputs:
{ flake, ... }:
let
inherit (flake) inputs self;
in
{
imports = [
self.nixosModules.default
self.nixosModules.hardware-thinkpad-z13
];
}