Skip to content

Releases: water-sucks/nixos

v0.11.0

18 Aug 10:59
0.11.0
33e4f76
Compare
Choose a tag to compare

What's Changed

Options Search TUI

nixos-option-cli.mp4

OK, this is pretty killer. You can now search through your NixOS options locally! Run nixos option -i to see what options are available for use in your configuration, and press to see their value.

Make sure to enable the options cache using the services.nixos-cli.prebuildOptionCache for much faster startup time.

Search results can be fine-tuned for how strict you want your matching to be. See the options.max_rank configuration option for more information.

Set Config Options On Command Line

Configuration properties can now be set with a command-line flag in the form of --config key=value.

This is to make setting configuration values easier without having to copy a configuration file or rebuild a configuration.

Other Features

  • feat(generation): collect garbage automatically upon deletion

Full Changelog: 0.10.0...0.11.0

v0.10.0

13 Aug 03:56
0.10.0
7ca490c
Compare
Choose a tag to compare

What's Changed

Generation Manager TUI

View information about and manage your generations graphically, directly within the terminal.

2024-08-12_19-35-16

This TUI makes it easier to look at your list of generations and view information about them. You can also:

  • Delete many generations using nixos generation delete
  • Switch to any generation within the list
  • Filter generations by description

With more to come in the future, if people request it.

Targeted Generation Deletion :: nixos generation delete

nixos generation delete does targeted removal of generation GC roots in the system profile. This allows for those generations to be collected by garbage collection only, provided the user is also not using nix-collect-garbage -d.

Garbage from these generations will remain until nix store gc is ran.

System Diffs + Interactive Activation Confirmation

Upon activation, (with either the apply, generation rollback, or generation switch commands), a diff between the current system and the system to be activated is shown. The user will need to confirm activation after looking at the differences. This can use either the builtin nix store diff-closures tool or nvd, if enabled in the config. Interactive activation can be disabled through the config or with a switch, if one desires.

Show Third-Party Module Options

https://search.nixos.org/options does not show you options in your current configuration. This builds an option cache on the fly for a given configuration using the entire collection of NixOS options, so now you can search through modules that you add to your configuration, such as sops-nix, agenix, home-manager and many more.

I plan on extending this functionality to include special integrations with separate module systems such as home-manager options, since these live in a separate evaluation from the NixOS modules, and thus are not discoverable by the current method of option cache generation. This will supercharge the nixos option command even more.

Bug Fixes

Full Changelog: 0.9.0...0.10.0

v0.9.0

30 Jul 07:40
0.9.0
929bd0a
Compare
Choose a tag to compare

What's Changed

New option Command

Searching NixOS options is kind of a pain. There are a few options available:

All of which suck for UX when you want to browse your current nixpkgs options offerings. So instead of those, this release now contains a new nixos option command that will show you similar options if typed incorrectly. This will be expanded upon in a TUI, similar to telescope.nvim, to enable seamless option searching.

  • feat(option): init option command
  • feat(option): show similar options upon failure
  • fix(option): remove trailing newlines from descriptions
  • fix(option): add includes to command arguments
  • fix(option): fix compile error for flake includes argv
  • feat(module): add option to prebuild option cache
  • feat(option): use prebuilt cache if it exists

Removal of Nix bindings

It's just slowing development down for minimal gain. Plus, the value of a static binary is not to be unstated.

Let's re-evaluate usage of this when we need it, now that we've used it as a proof of concept. It's possible that we can just use the Nix
CLI as a means of getting all the information that we need for now; yes, that does include options, which we can cache later.

Generation Improvements

Generations are now displayed in pretty form, and with colors! This can be toggled off with an env variable: NO_COLOR=1. Additionally, generations can now be tagged with a description upon invocation of nixos apply.

  • feat(apply): add a tag option for describing generations
  • feat(generation): pretty print dates
  • fix(info): show more relevant info in markdown
  • feat(log): add colors to log messages

Other Features/Bug Fixes

  • feat(info): allow passing multiple arguments
  • fix(apply): resolve install bootloader conflict condition
  • fix(module): make config rev show "unknown"
  • fix(repl): remove extra brackets from legacy expr
  • fix: de-duplicate flake ref parsing
  • feat(option): init option command
  • fix(alias): return result if alias is found
  • ci: add a flake update action for every week
  • ci: add a build/test action upon push
  • fix(init): sync nixpkgs state version with build option
  • feat(apply): add extra logging and steps
  • refactor(init): use arena allocator for string generation
  • fix: preserve env for sudo on re-exec
  • fix(config): do not fallback to defaults if bad values are detected
  • feat(repl): add a motd to the repl prompt
  • feat(apply): add config option to imply --impure with --tag
  • fix: remove usage of realpath()

Fuck realpath, all the homies hate realpath and its stupid idiosyncrasies.

Full Changelog: 0.8.0...0.9.0

v0.8.0

30 Jul 00:09
0.8.0
d5415cb
Compare
Choose a tag to compare

What's Changed

JSON -> TOML

This is more of an internal change, since configuration is managed in the NixOS module mostly, but TOML seems like a much more sane configuration format for this tool than JSON, which just feels clunky.

Configuration schema changes

Aliases are now specified as dynamic key-value pairs. Instead of the former:

[[aliases]]
alias = "genlist"
resolve = ["generation", "list"]

The configuration now looks like this:

[aliases]
genlist = ["generation", "list"]

This is also the case for init.extra_attrs.

nix-output-monitor support

This tool now supports using nix-output-monitor as an alternative front-end for building when running nixos apply.

Other Features/Bug Fixes

  • fix(config): do not exit early if config is invalid
  • feat(features): add linked nix version to info
  • fix(alias): add arguments past three (0-based indexing is great)
  • fix(module): remove extra_attrs from default init config
  • fix(apply): do not add flake enable flags
  • chore(deps): zig 0.12.0 -> zig 0.13.0, update deps
    • Update Zig to 0.13.0 (+ make it the required version)
    • Update dependencies to use Zig 0.13 APIs
    • Fix STD usage (ChildProcess, build.zig)
  • feat(config): allow specifying env var for config location
  • fix(generation): display help for generation diff
  • fix(generation): allow --profile to be passed anywhere
  • refactor(args): pass unparsed subcommand args up the stack

Full Changelog: 0.7.0...0.8.0

v0.7.0

29 Jul 22:23
0.7.0
9647350
Compare
Choose a tag to compare

What's Changed

NixOS REPL

This release adds a new subcommand, nixos repl. This is a thin wrapper around the Nix REPL that adds a NixOS system's configuration, pkgs set, and other attributes to scope for quick and easy access.

Other Changes

  • Nix C bindings have now been moved to an external repo at water-sucks/zignix.
  • Zig upgraded from 0.11.0 -> 0.12.0

Full Changelog: 0.6.0...0.7.0

v0.6.0

29 Jul 22:17
0.6.0
Compare
Choose a tag to compare

What's Changed

This release is a pretty substantial release. It comes with three major features:

Configuration

There are multiple different ways of configuring this tool to use certain behaviors by default. Some examples include:

  • Default specialisation on a machine
  • Extra attrs to add to configs generated by init

And this list will only grow as more commands are added. How should we go about this, then? Easy! Create a configuration file that can also be managed by a Nix module. This release brings exactly that; a config.json is available, exposed as a NixOS module taking JSON configuration.

  • feat(config): implement config with JSON
  • feat(config): refactor module to use single config option
  • refactor(init): use config.json for configuration options
  • refactor(apply): replace /etc/NIXOS_SPECIALISATION with configuration
  • refactor(apply): use config_location for location fallback
  • refactor(enter): mount resolv conf based on option
  • fix(init): use extra attrs/config options

Nix C Bindings

This brings a cool experiment! In the future, we may want to use the nix evaluator as a library, rather than as an external command.
This can allow for much more flexible usage of Nix functionality, including (but not limited to):

  • Serializing Nix ASTs for commands like init, to avoid fragile string concatenation.
  • Iterating through options and building an options cache with only the information that we need for searching.

This release does just that: it links to the (currently unstable) Nix C bindings, and uses it as an evaluator for the init command to find the current system. In the future, this usage will be expanded upon for more advanced use cases, but it may also disappear if external invocation ends up being more flexible.

  • feat: link to libnix in build.zig
  • feat(libnix): add initial bindings for libnixutil
  • feat(libnix): add libnixstore bindings
  • feat(libnix): add rudimentary libexpr bindings
  • refactor(init): use libnix for finding host platform
  • fix: add autoPatchelfHook to build derivation

Aliases

Aliases for running commands with lots of flags can now be configured in the aforementioned configuration file.

  • feat(alias): add alias subcommand to list available aliases
  • feat(alias): execute commands from alias

Other Features/Bug Fixes

  • chore: use ReleaseSafe mode again
  • feat(features): add optimize mode to info
  • feat(generation): start impl for diff subcommand
  • fix(apply): only re-exec as root for system activations

Full Changelog: 0.5.0...0.6.0

v0.5.0

29 Jul 19:13
Compare
Choose a tag to compare

What's Changed

It's been a while, and since a lot of commands were made even for the 0.1.0 release, I've bumped the minor version number directly to 0.5.0.

This brings in some minor UX improvements and bug fixes.

Features

  • feat(generation): elevate root privileges when invoked with non-root
  • feat(apply): elevate root privileges when invoked with non-root
  • feat: implement --version flag
  • feat: implement nixos manual command

Bug Fixes

  • fix(generation): use correct name for system profile rollback
  • fix(init): only print fs options when it exists
  • fix: pass git revision properly into nix builds

Full Changelog: 0.1.0...0.5.0

v0.1.0

29 Jul 18:59
Compare
Choose a tag to compare

What's Changed

This is the first release! 🥳

It contains pretty core features to the reimagined NixOS CLI, such as:

  • build :: a rewrite of nixos-rebuild
  • enter :: a rewrite of nixos-enter to chroot into a NixOS installation
  • generation :: a better way of managing generations more granularly
  • generate-config :: a rewrite of nixos-generate-config

While most of these are 1:1 rewrites of the original shell scripts (except for generation), I will be making these much more full-featured in future releases.

Full Changelog: https://github.com/water-sucks/nixos/commits/0.1.0