nix-stuff/.justfile

37 lines
992 B
Makefile

# Hide the default option from the recipes list
_default: print-recipes
# Escape codes for text formatting
bold := `tput bold`
normal := `tput sgr0`
find-results:
find . -name '*result*'
print-recipes:
@just --list
update:
nix flake update
# Update a single input
update-input input:
nix flake lock --update-input {{input}}
@edit-secrets:
git clone ssh://forgejo@git.everest.sable-pancake.ts.net:4222/Toast/nix-secrets.git /tmp/secrets
sed -i 's\git+ssh://forgejo@git.everest.sable-pancake.ts.net:4222/Toast/nix-secrets\/tmp/secrets\g' flake.nix
just -q update-input secrets
echo "{{bold}}All done!"
echo "{{normal}}Remember to restore flake.nix"
echo ""
echo ""
alias build := build-nixos
# Build a NixOS configuration
build-nixos host=`hostname`:
nixos-rebuild build --flake .#{{host}}
# nix-diff with some parameters piped to less
nix-diff left right:
nix-diff --color=always --skip-already-compared {{left}} {{right}} | less -F