A shell script wrapper that uses nix-output-monitor to build NixOS configurations with pretty output. It's a drop-in replacement for nixos-rebuild with enhanced build visualization.
Note: Currently only supports flake-based NixOS systems. PRs welcome for non-flake support.
pretty-switch [nixos-rebuild-command]- Runs
nixos-rebuildwithnix-output-monitorfor prettier output - Default command:
switch - Example:
pretty-switch testto test config
- Uses nix-output-monitor to build the NixOS configuration for the current system
- Uses nixos-rebuild to apply the configuration
-
Add the flake to your inputs:
{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; pretty-switch.url = "github:noblepayne/pretty-switch"; pretty-switch.inputs.nixpkgs.follows = "nixpkgs"; }; }
-
Import the NixOS module:
{inputs, ...}: { imports = [inputs.pretty-switch.nixosModules.default]; }
This can be done at the flake level or within your configuration.
-
Rebuild system:
nixos-rebuild switch --flake .#
# Build with pretty output
pretty-switch
# Build and test
pretty-switch test