nixos-rsbuild is a (slightly opinionated) rewrite of the nixos-rebuild cli utility. The goals are as follows
- minimal barrier-of-entry to read/write the codebase in a meaningful way
- provide a pleasant documentation/help UX
- showcase Rust as an implementation tool in the nix/nixos ecosystem
- (Initially): Stand-in replacement for most of my build/switch/etc. needs
- (Stretch): Cover all supported use-cases of
nixos-rebuild
- (TODO) Will fail if cannot find a
flake.nixunless--no-flakeis used - Makes more args/flags mutually exclusive.
--upgrade-allimplios--upgrade, so providing both will be an error. - Aims to be relatively platform agnostic.
- no
sudo: can only run as non-root user. in future, will add--sudo | -sflag to relevant subcommands in place of--use-remote-sudo
cargo run -- <args>
cargo run -- -hshow top level helpcargo run -- --helpshow top level help in long-formcargo run -- <builders | utils> -hshow information on the two classes of taskscargo run -- <subcommand> <task> --helpshow task help in long-form
If you are reading this, you are probably a Nix/NixOS nerd. If you are curious and/or skeptical about Rust, particularly in the Nix/NixOS ecosystem, I strongly encourage you to ask questions, express your skepticism, and other wise promote lively discussion we can all enjoy.
NOTE: <flakeref> => /path/to/dir#flake.attr
-
nixos-rsbuild list-generations [--json] -
nixos-rsbuild build -
nixos-rsbuild build --flake /path/to#machine_name -
nixos-rebuild boot --flake <flakeref>->nixos-rs boot <flakeref> -
nixos-rebuild boot->nixos-rsbuild boot --config -
nixos-rebuild test ...->nixos-rsbuild test ... -
nixos-rebuild switch ...->nixos-rsbuild switch ... -
nixos-rebuild switch | boot | test ... --use-remote-sudo->nixos-rsbuild <switch | boot | test> -s ...
- split out things into a library to leverage
cargo doc - add
no_opfeature so as to only emulate changes in the output - black-box testing
- white-box testing
- system-level testing
- non-local target-aware
- non-local builde-aware