2026-07-05 08:56:32 -05:00
2026-07-04 23:19:35 -05:00
2026-07-05 08:56:32 -05:00
2026-05-06 20:25:55 -05:00
2026-07-04 23:19:35 -05:00
2026-07-04 11:52:15 -05:00
2026-07-01 22:39:57 -05:00
2026-07-01 22:40:04 -05:00

A Dendritic Nix Flake

Regenerate flake and switch to it.

nix run .#write-flake
nix flake check
home-manager switch --flake .#desktop
nix flake show --all-systems
nix run nixpkgs#nh home switch -- --configuration john@john-pc-ubuntu .

Host Intent

Host key Type Intent Entrypoint
janus NixOS (LXC) Base homelab/service host with local step-ca trust bootstrap (janus-ca) and mTLS support. modules/hosts/janus/default.nix
john-kde Home Manager (generic Linux) KDE-focused user environment profile for john with desktop + docker + step client tooling. modules/hosts/john-kde/default.nix
john-p14s NixOS (laptop) Main ThinkPad P14s NixOS workstation using hardware presets and desktop/dev modules. modules/hosts/john-p14s/default.nix
john-pc-ubuntu Home Manager (generic Linux) Ubuntu-hosted home profile for john, includes desktop/dev tooling and restic backup client settings. modules/hosts/john-pc/default.nix
omen-nixos NixOS Omen machine wired through shared omen-nixos + john modules. modules/hosts/omen-nixos/default.nix
soteria NixOS + Home Manager Service node running Forgejo + restic server with mTLS and host-local secrets. modules/hosts/soteria/soteria.nix
test-nix NixOS (LXC) Minimal sandbox/test target for validating module composition and remote push/switch flows. modules/hosts/test-nix.nix

Layout

  • Everything under ./modules gets auto-imported by import-tree
Directory Description
hosts Provides either homeConfigurations or nixosConfigurations
nix-tools Nix-specific tools, like factory functions for use in the flakes
nixos flake.modules.nixos
programs flakes that provide flake.modules attributes for specific programs
services flakes that provide configuration for running services
users flakes that provide configuration for individual users with the flake.factory.user factory

Mechanics

Flake

The top-level flake is created using flake-file

nix flake init -t github:vic/flake-file#default
...
nix run ".#write-flake"

This uses inputs.flake-parts.lib.mkFlake to create the flake.

The modules are automatically imported from the ./modules using import-tree.

Home Manager

Uses the home-manager module of flake-parts, which is imported in modules/home-manager/flake-parts.nix

Looks for options:

  • flake.homeConfigurations
  • flake.homeModules

Show exported home configurations:

nix eval --apply builtins.attrNames .#homeConfigurations

Testing

These commands would are useful for debugging

SYSTEM=lxc

# Just evaluate (fast, catches config errors)
nix eval .#nixosConfigurations.${SYSTEM}.config.system.build.toplevel

# Full build (slower, produces a bootable system)
nix build .#nixosConfigurations.${SYSTEM}.config.system.build.toplevel

Remote Deploy

nixos-rebuild switch --flake .#lxc --target-host root@fded:fb16:653e:25da:be24:11ff:fea0:753f
S
Description
No description provided
Readme
806 KiB
Languages
Nix 94.9%
Shell 5.1%