Installing
knixl is a single binary. Pick whichever install suits you, then make sure the two things it calls out to (Nix and a Nix formatter) are on your PATH.
With Nix
Section titled “With Nix”nix run github:1stvamp/knixl -- --help # try it without installingnix profile install github:1stvamp/knixl # install into your profileOn NixOS or home-manager you can use the flake’s overlay instead: add overlays.default to your nixpkgs overlays and put pkgs.knixl in environment.systemPackages or home.packages.
The flake build brings its own nixfmt, which knixl only uses when you don’t already have one on your PATH.
With cargo
Section titled “With cargo”cargo install knixlPrebuilt binaries
Section titled “Prebuilt binaries”Every release has archives for Linux (glibc and musl) and macOS, on x86_64 and aarch64. There’s also an installer script:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/1stvamp/knixl/releases/latest/download/knixl-installer.sh | shEach archive carries a build provenance attestation, so gh attestation verify <archive> -R 1stvamp/knixl confirms it was built by the project’s release workflow.
What knixl needs at runtime
Section titled “What knixl needs at runtime”- A Nix formatter. knixl formats everything it writes, so it needs
nixfmt(ornixfmt-rfc-style) on yourPATH. SetKNIXL_FORMATTERto use a specific binary. The formatter’s version is recorded in the lockfile, because a different nixfmt can format the same code differently. - Nix. Generating doesn’t need Nix itself, but a few things do:
knixl installuses it to check that the package you’re adding exists (and builds, with--build), and validation needs a NixOS option set that Nix builds (see Validation and the oracle). Without Nix,installskips its check with a warning, so you can still work. - git and network access, now and then. Resolving a nixpkgs release to a commit uses
git ls-remote(falling back to the GitHub API), and resolving a package version pin queries the nixhub version index over HTTPS. Both happen only inknixl installandknixl upgrade;generateandcheckwork offline.
Check it all works:
knixl --versionThen carry on to Your first host.
