Multi-host NixOS flake with integrated Home Manager. Sessions: Hyprland, Niri, or Plasma behind SDDM. Desktop chrome is desktop.sessionShell (noctalia, dms, caelestia, inir, ii, or none). Theming via Stylix, secrets via sops-nix, rebuilds via tcli/nh. Targets nixpkgs-unstable and Determinate Nix.
default: generic VM-safe reference profile for new installstandesk: physical desktop profiletanlappy: Niri laptop profile with power/lid/battery defaults
The flake profile name and installed machine hostname are separate. For example, default can build a machine whose hostname is alice-pc.
flake.nix: parts-wrapped flake entrypoint viaflake-partsmodules/flake/*: host registry, external module injection (including Determinate Nix), packages, and outputsmodules/combined/stacks.nix: shared NixOS and Home Manager stack wiringlib/host-registry.nix: authoritative host profiles, platforms, entry modules, and ordered variable fragmentshosts/common/variables-schema/*: typedconfig.nagi.variablesschema by domainhosts/profiles/*: ordered variable fragments shared by selected hostshosts/<host>/variables.nix: host identity, toggles, and valueshosts/<host>/default.nix: host-specific system wiringmodules/nixos/*: NixOS modulesmodules/home/*: Home Manager modulesusers/default/home.nix: generic primary-user Home Manager entrypoint
This repo assumes base NixOS is already installed.
- Clone this repo anywhere on the target machine.
- Pick a profile:
default,tandesk, ortanlappy. - Run bootstrap with your own user, hostname, and checkout path:
sudo ./install/bootstrap.sh default --user alice --hostname alice-pc --flake-dir /home/alice/nagiBootstrap validates the profile through lib/host-registry.nix, writes those values into hosts/<profile>/variables.nix, generates hardware config when needed, and activates the system plus integrated Home Manager through one nixos-rebuild path.
The standalone homeConfigurations.<profile> outputs remain available for manual recovery:
home-manager switch --flake .#defaultEvery NixOS host imports Determinate Systems' official NixOS module. It provides:
- Determinate Nix, including parallel evaluation and lazy trees
determinate-nixdfor daemon management and FlakeHub authenticationfh, the FlakeHub CLI- Determinate Nix compatibility for both integrated and standalone Home Manager
The flake keeps custom daemon settings in the declaratively generated /etc/nix/nix.custom.conf; Determinate Nixd owns /etc/nix/nix.conf. The Determinate installer is not used on NixOS.
Authenticate after activation when FlakeHub access is needed:
determinate-nixd login
determinate-nixd statusCommon FlakeHub commands:
fh search "nixos"
fh add nixos/nixpkgstcli is installed via Home Manager and is the recommended day-to-day command for this repo. It handles system rebuilds through nh os; Home Manager is applied through the NixOS home-manager module.
Commands:
tclidefaults toswitchon the current hosttcli rebuild [switch|build|test|boot] [host]tcli update [host]tcli gctcli nh home [switch|build] [host]tcli checknix fmt -- --check
Defaults:
- host defaults to current machine hostname
- flake path resolves from
NAGI_FLAKE_DIR, current git root, current directory, then$HOME/nagi
- Bootstrap with full system and Home Manager activation:
sudo ./install/bootstrap.sh <profile> --user <user> --hostname <hostname> --flake-dir <absolute-path>
- System build:
sudo nixos-rebuild build --flake .#<profile>
- System switch:
sudo nixos-rebuild switch --flake .#<profile>
- Home Manager only:
home-manager switch --flake .#<profile>
Most user-facing apps should be installed through Home Manager by adding package names to users.extraPackages in hosts/<host>/variables.nix.
users = {
primary = "nagi";
flakeDirectory = "/home/nagi/nagi";
extraPackages = [
"obsidian"
"mpv"
"python3Packages.ipython"
];
};Package names resolve from pkgs, so nested attributes such as "python3Packages.ipython" work. Wrong package names fail evaluation with an assertion.
For Flatpak apps, use features.flatpak.packages in the host variables file:
features.flatpak = {
enable = true;
packages = [
"com.spotify.Client"
"md.obsidian.Obsidian"
];
};Pull requests run a fast, unprivileged validation tier with Determinate Nix:
- Nix formatting, Statix, ShellCheck, and syntax parsing for every tracked Nix file
- focused tcli, repo-sync, orphan-scanner, and Codex Desktop transformation tests
nix flake check --no-build --accept-flake-config, which evaluates every published NixOS and standalone Home Manager configuration
The workflow runs only for pull requests. Pushes to main and manual dispatches do not start CI.
MO2-LINT exposes passthru.updateScript and can be updated reproducibly with nix-update:
nix run nixpkgs#nix-update -- --flake mo2-lint
nix build .#mo2-lintThe T3 Code CLI comes from llm-agents. The desktop comes from the independently
pinned t3code-nightly-nix input, whose automation checks upstream every six
hours, validates the newest nightly AppImage, and publishes it to Cachix.
tcli update moves the local lock to the newest validated package revision.
- Host variable reference:
docs/VARIABLES.md tclibehavior:docs/TCLI.md- repository synchronization:
docs/REPO_SYNC.md - sops key and secret setup:
docs/SOPS.md - adding a host:
docs/NEW_HOST.md - flake-parts structure:
docs/DENDRITIC.md - secure boot setup:
docs/SECURE_BOOT.md - local compatibility patches and upstream trackers:
docs/WORKAROUNDS.md
defaultis intended as a buildable reference host, not a private machine profile.hardware-configuration.nixplaceholders are overwritten by bootstrap when needed.- The shared host data model is
config.nagi.variables. - This setup targets
nixpkgs-unstableand uses Determinate Nix as its only Nix distribution. - Niri uses the compositor from host
nixpkgsfor Mesa/ABI alignment whilesodiboo/niri-flakesupplies only the KDL/Home Manager configuration API. - Hyprland uses the native scrolling layout and Home Manager Lua config; per-host monitor, HDR, and monitor-local workspace ranges live under
desktop.hyprland.outputs.