This commit is contained in:
@@ -26,6 +26,23 @@ clean:
|
||||
sudo nix-store --optimise
|
||||
sudo {{ if os() == "macos" { "darwin-rebuild switch" } else { "nixos-rebuild boot" } }} --flake .#{{host}}
|
||||
|
||||
# Format every .nix file in the repo with nixfmt (RFC 166 style).
|
||||
# Runs inside the devShell, so it works with or without direnv loaded.
|
||||
fmt:
|
||||
nix develop -c bash -c "find . -name '*.nix' -not -path './iso/*' -not -path './.direnv/*' -exec nixfmt {} +"
|
||||
|
||||
# Lint Nix for anti-patterns (statix) and dead/unused bindings (deadnix).
|
||||
# Exits nonzero on findings, so it doubles as a CI check.
|
||||
lint:
|
||||
nix develop -c statix check .
|
||||
nix develop -c deadnix --fail .
|
||||
|
||||
# Preview what the next `rebuild` would change: build the target system
|
||||
# without switching, then diff it against the running one.
|
||||
diff:
|
||||
nix build --out-link /tmp/notfiles-next {{ if os() == "macos" { ".#darwinConfigurations." + host + ".system" } else { ".#nixosConfigurations." + host + ".config.system.build.toplevel" } }}
|
||||
nix develop -c nvd diff /run/current-system /tmp/notfiles-next
|
||||
|
||||
# Generate Ed25519 SSH keys for each named service (default: github gradescope).
|
||||
# Override: just gen-keys gitlab bitbucket
|
||||
gen-keys *services='github gradescope h2p durrantlab signing_git scienting_git scienting_static_sites':
|
||||
|
||||
Reference in New Issue
Block a user