shell.nix: wrap nixos-rebuild with nix-output-monitor
\#nix-output-monitor-and-chill nom is only used if the output is a tty, and I provide a escape hatch in the form of NIX_NO_NOM=1. This solution sidesteps issues like `sudo nixos-rebuild ... |& nom` capturing the sudo password prompt.
This commit is contained in:
12
shell.nix
12
shell.nix
@@ -1,6 +1,18 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
let
|
||||
nixos-rebuild-nom = pkgs.writeScriptBin "nixos-rebuild" ''
|
||||
if [[ -t 1 && -z "''${NIX_NO_NOM-}" ]]; then
|
||||
exec ${pkgs.lib.getExe pkgs.nixos-rebuild} -L "$@" |& ${pkgs.lib.getExe pkgs.nix-output-monitor}
|
||||
else
|
||||
exec ${pkgs.lib.getExe pkgs.nixos-rebuild} -L "$@"
|
||||
fi
|
||||
'';
|
||||
in
|
||||
|
||||
pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [
|
||||
nixos-rebuild-nom
|
||||
just
|
||||
jq
|
||||
gum
|
||||
|
Reference in New Issue
Block a user