README.md

4.7 KB · raw

rendered · source

1# nina23**the best way to use nixos.**45Nina wraps the full NixOS workflow in plain, memorable verbs — packages, rebuilds, generations, flakes, services, remote machines. Written in Zig. Zero dependencies. One binary.67```8$ nina search ripgrep9$ nina apply10$ nina back11$ nina status --all12```1314---1516## install1718```sh19curl -fsSL kepr.uk/nina/install.sh | sh20```2122or clone and build:2324```sh25koh steal kepr.uk/nina26cd nina && zig build -Doptimize=ReleaseFast27sudo cp zig-out/bin/nina /usr/local/bin/nina28```2930**linux · nixos 24.05+** — requires `nix-command` and `flakes` experimental features.  31Run `nina setup` on first use to enable them automatically.3233---3435## the commands you'll actually use3637```38nina apply           rebuild and switch to the new configuration39nina apply --dry     preview what would change without switching40nina back            roll back to the previous generation41nina go <n>          jump to any generation by number42nina history         list all generations43nina clean           remove old generations and free store space4445nina search <q>      search nixpkgs inline — browse, install, or try46nina option <q>      search NixOS options inline47nina install <p>     add a package — profile (instant) or system config48nina remove <p>      remove a package from profile or system config49nina try <p>         run a package without installing it50nina list            show installed packages5152nina status          machine health at a glance53nina status --all    health across every configured machine54nina doctor          diagnose common issues55nina diff            what changed between generations56nina log             operation history5758nina service list    list systemd services and their state59nina service logs <s> journal logs for a service60nina service start/stop/restart <s>6162nina flake show      inspect flake outputs63nina flake update    update lock files64nina develop         enter a dev shell65nina build           build a flake output66nina run <p>         run a package without installing6768nina edit            open configuration.nix in your editor69nina check           validate config without switching70nina fmt             format nix files71nina info            nixos version, kernel, uptime72nina boot            boot entries7374nina help            all commands75nina --version       version info76```7778---7980## multi-machine8182Any command runs on a remote machine with `--on <name>`. Configure machines in `~/.nina.conf`:8384```ini85[machine]86name    = kyoshi87config  = /etc/nixos88local   = true89default = true9091[machine]92name    = azula93host    = azula94user    = june95ssh_key = ~/.ssh/id_ed2551996```9798```99nina apply --on azula100nina service logs ollama -f --on azula101nina status --all102```103104```105:: status106107   kyoshi   gen 348   3m ago    42 GB108   azula    gen 192   14m ago   18 GB109```110111---112113## search that stays at the prompt114115`nina search` opens an inline widget — no fullscreen takeover. Browse results, see versions and licenses, install to your profile or system config, copy the attr name, or try the package in a temporary shell.116117```118:: search nixpkgs  ripgrep                          12 results119120   > ripgrep        14.1.1   free    fast line-oriented search121     ripgrep-all    0.9.6    free    search across file formats122     ugrep          6.0.0    free    grep compatible ripgrep alt123124   ripgrep  14.1.1  free125   recursively search directories for a regex pattern126   attr   pkgs.ripgrep127128   [i] profile  [s] system  [t] try  [c] copy  [esc] exit129```130131---132133## install that actually works134135`nina install` uses `nix search nixpkgs` directly — no external API, no network dependency after your first channel update, no silent failures. Works offline.136137Two install paths, your choice:138139- **profile** — instant. package available immediately. no rebuild.140- **system** — opens your editor at the right line in `configuration.nix`, then offers to apply.141142---143144## config145146`~/.nina.conf` — plain text, no surprises:147148```ini149editor      = hx150generations = 5151confirm     = true152teach       = false153color       = true154155[machine]156name    = my-machine157config  = /etc/nixos158local   = true159default = true160```161162`teach = true` prints the underlying nix command after each operation so you learn while you work.163164---165166## what nina outputs167168```169:: rebuilding kyoshi...170171   -> [build output]172173:: generation 14  [42.3s]174```175176```177:: error: 'firefocks' not found in nixpkgs178   -> try: nina search firefox179```180181Pink `::` marks Nina's voice. Green for success. Red for errors. Yellow for warnings. Color auto-disables when stdout is not a TTY. Respects `NO_COLOR`.182183---184185## built by186187[asha software](https://asha.software) — hope in every line of code.188189**[nina.asha.software](https://nina.asha.software)** · [source](https://kepr.uk/nina) · [docs](https://nina.asha.software/docs)