flake: add "check-nur" app to validate that my repo passes NUR checks

This commit is contained in:
Colin 2023-06-26 01:26:13 +00:00
parent 7aa0c5e3ea
commit 9b3ee537a8
2 changed files with 17 additions and 0 deletions

View File

@ -276,6 +276,22 @@
type = "app";
program = ''${deployScript "switch"}'';
};
check-nur = {
# `nix run '.#check-nur'`
# validates that my repo can be included in the Nix User Repository
type = "app";
program = builtins.toString (pkgs.writeShellScript "check-nur" ''
cd ${./.}/integrations/nur
NIX_PATH= NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-env -f . -qa \* --meta --xml \
--allowed-uris https://static.rust-lang.org \
--option restrict-eval true \
--option allow-import-from-derivation true \
--drv-path --show-trace \
-I nixpkgs=$(nix-instantiate --find-file nixpkgs) \
-I ../../
'');
};
};
templates = {

View File

@ -22,6 +22,7 @@
# ^ source: <https://github.com/nix-community/nur-packages-template/blob/master/.github/workflows/build.yml#L63>
# N.B.: nur eval allows only PATH (inherited) and NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM="1" (forced),
# hence the erasing of NIX_PATH above (to remove external overlays)
# - or do: `nix run '.#check-nur'` via the toplevel flake.nix in this repo
#
# if it validates here but not upstream, likely to do with different `nixpkgs` inputs.
# - CI logs: <https://github.com/nix-community/NUR/actions/workflows/update.yml>