Skip to content
leoankPublic

About

Flake-based NixOS / nix-darwin / home-manager library and CLI for managing a fleet.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

Neusis

In geometry, the neusis (νεῦσις; from Ancient Greek νεύειν (neuein) 'incline towards'; plural: νεύσεις, neuseis) is a geometric construction method that was used in antiquity by Greek mathematicians. -- Wikipedia

Documentation: https://leoank.github.io/neusis/

Neusis is a flake-based configuration library for NixOS, nix-darwin and home-manager, plus a CLI that scaffolds and grows a fleet repository on top of it. You describe your machines, the people who log into them, and what each person gets on each machine as typed data. Neusis builds the nixosConfigurations, darwinConfigurations and homeConfigurations from it.

  • neusis CLI: wizard-driven scaffolding. neusis init creates a fleet repo, and neusis add machine | user | registry | secrets grows it.
  • Library: the flake.neusis.* schema, the mkNeusisFlake / mkNeusisOS / mkNeusisDarwinOS builders, and flakeModules to import them into any flake-parts flake.
  • Modules: opt-in home-manager modules (supercharged-git, supercharged-shell, terminal-velocity, agent-harness, …), system modules that work on both NixOS and nix-darwin (tailscale, kanata, secrets, distributed builds, …) and config-only features.

Quickstart

curl -fsSL https://raw.githubusercontent.com/leoank/neusis/main/cli/install.sh | sh
# or: nix run github:leoank/neusis#neusis -- init my-fleet

neusis init my-fleet --darwin
cd my-fleet
neusis add machine laptop --system aarch64-darwin
neusis add user alice --full-name "Alice Example"

git add . && nix run .#write-flake && nix flake lock
sudo darwin-rebuild switch --flake .#laptop

The Quickstart guide walks through each step, including giving users a home-manager setup.

Documentation

The reference is generated from this repository on every push to main. The site's source lives on the gh-pages branch.

Using the library without the CLI

# a flake-parts module in your flake
{ inputs, ... }: {
  imports = [ inputs.neusis.flakeModules.default ];
}

See Using neusis without the CLI and the consumer flakes in examples/.

Repository layout

This flake is also its author's fleet config, built with the same library it exports. It follows the dendritic pattern: every file under modules/ is a flake-parts module, auto-imported with import-tree, and flake.nix is generated by flake-file.

  • modules/: the library (lib/, agnosticModules/, homeModules/, features/, …) and the author's own machines/ and users/
  • cli/: the neusis CLI (Go). See cli/README.md
  • templates/: nix flake init -t github:leoank/neusis#<name> project templates
  • docs/: tutorials and development notes (published on the site)
  • old_modules/: the complete pre-refactor tree, kept verbatim (also tagged v1)

Development

nix develop                                       # dev shell
nix run .#write-flake && nix flake update <input> # after changing a flake-file.inputs declaration
cd cli && go test ./...                           # CLI tests
nix build .#darwinConfigurations.rogue.system     # build-only check of a host

See AGENTS.md for conventions and the verification ladder.

About

Flake-based NixOS / nix-darwin / home-manager library and CLI for managing a fleet.

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages