deprecate stylix, fix minor gripes and bugs
This commit is contained in:
parent
6b492bad2f
commit
fb1ad8d919
42 changed files with 951 additions and 688 deletions
36
util/pre_commit_nix_eval.sh
Normal file
36
util/pre_commit_nix_eval.sh
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(git rev-parse --show-toplevel)"
|
||||
flake_ref="path:${repo_root}"
|
||||
|
||||
# Use a path flake ref so ignored files, especially the local flake.lock, are
|
||||
# visible to Nix even though the repository itself is a Git worktree.
|
||||
targets_text="$(
|
||||
nix eval \
|
||||
--raw \
|
||||
--no-write-lock-file \
|
||||
"${flake_ref}#nixosConfigurations" \
|
||||
--apply 'configs: builtins.concatStringsSep "\n" (builtins.attrNames configs)'
|
||||
)"
|
||||
|
||||
targets=()
|
||||
while IFS= read -r target; do
|
||||
if [ -n "${target}" ]; then
|
||||
targets+=("${target}")
|
||||
fi
|
||||
done <<< "${targets_text}"
|
||||
|
||||
if [ "${#targets[@]}" -eq 0 ]; then
|
||||
echo "No nixosConfigurations found to evaluate." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for target in "${targets[@]}"; do
|
||||
echo "Evaluating nixosConfigurations.${target}.config.system.build.toplevel"
|
||||
nix eval \
|
||||
--raw \
|
||||
--no-write-lock-file \
|
||||
"${flake_ref}#nixosConfigurations.${target}.config.system.build.toplevel.drvPath" \
|
||||
>/dev/null
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue