No description
  • Rust 83.3%
  • Nix 16.2%
  • Shell 0.5%
Find a file
2026-06-20 10:38:12 +02:00
cli (feat): convert cli cleanup into systemd service 2026-06-20 10:38:12 +02:00
.gitignore stuff 2026-05-12 16:05:46 +02:00
flake.lock (feat): move cli config to options.lunitely.cli 2026-05-22 22:40:27 +02:00
flake.nix (feat): add lunitely install command 2026-06-16 20:05:49 +02:00
module.nix (feat): convert cli cleanup into systemd service 2026-06-20 10:38:12 +02:00
README.md Update stuff 2026-06-16 21:02:36 +02:00

Lunitely CLI

lunitely is a small NixOS helper for rebuilding and installing systems from flakes.

Rebuild

lunitely rebuild
lunitely boot
lunitely update

The rebuild commands use FLAKE_PATH, GIT_PATH, and HOSTNAME from the environment or from the NixOS module wrapper.

Install

Clone a configuration repository and install the local machine:

lunitely install https://my.cool/git/repo

Install a remote machine:

lunitely install https://my.cool/git/repo --remote "my.server -p 888 -o 'StrictHostKeyChecking no'"

--remote is parsed like shell words. Lunitely generates a temporary SSH key, copies it to the remote host with ssh-copy-id, and then uses that key for the remote nixos-facter step and for nixos-anywhere. Remote facter runs through nix --extra-experimental-features nix-command --extra-experimental-features flakes shell nixpkgs#nixos-facter -c ... so the remote host does not need nixos-facter preinstalled. nixos-anywhere is run locally against the first remote argument as the target host, with the remaining arguments passed as SSH options.

The repository is always cloned to /var/cache/lunitely/install-repo. Any existing directory at that path is deleted before cloning. The cache directory is owned by the local user before cloning so local flake evaluation can read the Git repository. After a successful install, /var/cache/lunitely/install-repo is deleted, and /var/cache/lunitely is removed if it is empty.

.lunitely

The root of the install repository must contain a .lunitely TOML file:

setup_cmd = "./someScriptThatSetsUpStuff.sh"
flake = "/config#my@hostname"

setup_cmd runs interactively in the cloned repository directory before installation.

flake is resolved relative to /var/cache/lunitely/install-repo when it contains #. For example, /config#my@hostname becomes /var/cache/lunitely/install-repo/config#my@hostname.

If flake does not contain #, it is treated as just the host name. For example, my@hostname becomes /var/cache/lunitely/install-repo#my@hostname.