Personal Nix configurations for Linux and macOS hosts, built as a single flake.
This repository contains:
- NixOS system definitions for a desktop machine and a WSL machine
- a nix-darwin system definition for one macOS host
- shared modules for core settings, desktop features, services, and user programs
- secrets management with
sops-nix
Supported platforms are x86_64-linux and aarch64-darwin.
Standalone homeConfigurations outputs are currently kept only for compatibility; active Home Manager setups are integrated into the NixOS and nix-darwin hosts defined in this flake.
- Linux system and Home Manager targets use
nixpkgswithhome-manager - macOS system and Home Manager targets use
nixpkgs-darwinwithhome-manager-darwin - nix-darwin tracks
mastertogether withnixpkgs-darwinonnixpkgs-unstable
sunflower: WSL-based NixOS host, also acts as a remote build targetdahlia: personal NixOS laptop with Hyprland; disko-managed LUKS + btrfs root with TPM2 auto-unlock
hydrangea: personal macOS machine
| Host | Platform | Role |
|---|---|---|
sunflower |
NixOS / WSL | personal Linux-on-WSL environment, remote build target |
dahlia |
NixOS | personal laptop with Hyprland, LUKS+btrfs via disko |
hydrangea |
nix-darwin | personal macOS machine |
Work-related hosts (work_mac, work_vm) live in the private tnmt-work-flake repository, which consumes this flake via mynix.lib.
.
├── flake.nix # Flake inputs, outputs, devShell, formatter, helper app
├── lib/ # Reusable host/HM builders, exposed as `mynix.lib`
├── hosts/ # Concrete host entrypoints
├── home-manager/ # Reusable Home Manager modules
├── modules/ # Reusable NixOS and cross-host modules
├── profiles/ # Role-based profiles (common, nixos, home-manager, darwin)
├── secrets/ # sops-encrypted secret files
├── themes/ # Shared theme definitions
└── treefmt.toml # Formatter configuration
The important split is:
hosts/selects a machine and wires modules togethermodules/holds lower-level reusable system pieceshome-manager/holds reusable user-level piecesprofiles/bundles opinionated groups of modules per layer (common, nixos, home-manager, darwin)lib/exposes the host builders (mkNixosSystem,mkDarwinSystem,mkHomeManagerConfiguration, …) reused by downstream flakes such astnmt-work-flake
- Hyprland desktop setup with Waybar, Walker, Mako, Hyprlock, Hypridle, Wlogout, and
hyprdynamicmonitors(config generated as Lua for Hyprland 0.55+) greetd+tuigreetlogin flow for the Linux desktop profiledisko+ LUKS + btrfs + TPM2 auto-unlock for thedahlialaptop;wayvncfor remote access to its running Hyprland session- NetBird mesh VPN enrolment via
mynix.profiles.netbirdon NixOS hosts (replaced Tailscale) mynix.services.shizukulocal memory server, sourced from a privateshizukuflake input and enabled ondahliaandhydrangeasops-nixsecrets unified at the system layer; host SSH key decryption is the default for every host- Input remapping with
kanata(Linux) and Karabiner-Elements (macOS) - Shared Tokyo Night Storm theme wiring
- Custom packages pulled directly from the
nur-tnmtinput via overlay (no NUR aggregator) - Declarative Homebrew casks and Mac App Store apps (
masApps) on the darwin host
Before switching a host, make sure the target machine has:
- Nix with flakes enabled
nhavailable if you want to use the recommended commands below- an SSH host key registered in
.sops.yamlsosops-nixcan decrypt secrets at activation time - SSH access to the private
shizukurepository, since it is agit+sshflake input (CI swaps it for a stub via--override-input)
nix run .#switch reads the current hostname and dispatches to the matching nh os / nh darwin command, so you don't need to remember the platform or host flag.
# Rebuild & activate the current host
nix run .#switch
# Pass extra args through to nh (after `--`)
nix run .#switch -- --dry
nix run .#switch -- -H sunflower# Recommended
nh os switch . -H dahlia
# Directly
sudo nixos-rebuild switch --flake .#dahlia# Recommended; also activates the matching Home Manager user.
nh darwin switch . -H hydrangea
# Directly
darwin-rebuild switch --flake .#hydrangea# Enter the dev shell
nix develop
# Format Nix and TOML files
nix fmt
# Update a flake input (from the dev shell)
update-input nixpkgs github:NixOS/nixpkgs/nixos-unstable
# Run the desktop VM for dahlia
nix run .#dahlia-vmFor local development, enable the repo's git hooks once:
git config core.hooksPath .githooksThe pre-commit hook formats staged files with nix fmt, lints with deadnix / statix, and scans staged changes with gitleaks protect.
This repo expects sops-nix with the host's SSH host key available for decryption (derived to age via ssh-to-age); each host's public key is registered in .sops.yaml.
- host/system-specific secrets live in
secrets/hosts/<hostname>.yaml - Home Manager identity secrets use
secrets/roles/personal.yamlby default - shared Home Manager values, such as service endpoints or API keys, live in
secrets/common.yaml - application-specific secrets live under
secrets/apps/<app>/ - both system and Home Manager secrets are wired through the system-layer
sops-nixmodule
Builds may evaluate without secrets in some cases, but activation on real machines assumes the corresponding host SSH key exists.
GitHub Actions currently checks:
- formatting via
nix fmt - lint via
deadnixandstatix - secret scan via
gitleaksover the full history - NixOS builds for
sunfloweranddahlia - darwin evaluation for
hydrangea(evaluates the full system on a Linux runner to catch option/module errors; actual builds require a macOS runner)
CI runners have no SSH key for the private shizuku input, so builds and evals override it with a stub flake under .github/ci-stubs/.
Personal configuration files. Reuse with care.