Closed srid closed 1 month ago
In conjunction with https://github.com/juspay/nix-dev-home/pull/39
and:
we get:
I guess the only thing left to do is ... that giant warning? We could possibly use figlet
for that:
❯ echo 'See errors above' | , figlet
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
____ _
/ ___| ___ ___ ___ _ __ _ __ ___ _ __ ___ __ _| |__ _____ _____
\___ \ / _ \/ _ \ / _ \ '__| '__/ _ \| '__/ __| / _` | '_ \ / _ \ \ / / _ \
___) | __/ __/ | __/ | | | | (_) | | \__ \ | (_| | |_) | (_) \ V / __/
|____/ \___|\___| \___|_| |_| \___/|_| |___/ \__,_|_.__/ \___/ \_/ \___|
Or, with:
devShells.default = pkgs.mkShell {
shellHook = ''
trap "${lib.getExe pkgs.toilet} NIX SHELL FAILED --filter gay -f smmono9" ERR
${lib.getExe pkgs.nix-health} --quiet .
'';
}
we get:
https://github.com/juspay/nix-health?tab=readme-ov-file#adding-devshell-check
@shivaraj-bh Is this good enough, or should we improve the ergonomics further?
EDIT: n/m - #18 should be good enough; see example https://github.com/srid/emanote/commit/fcf67dca2e7a95e4c5ac187586dc1e92dea530cf
The idea is to have
nix-health --quiet --giant-warning
run as part of devShell'sshellHook
such as to make it difficult for the user to miss errors from nix-health (especially as shellHook cannot "interrupt" the devShell) and yet make nix-health quiet in cases it succeeds.