forked from colin/nix-files
flake: add "check-nur" app to validate that my repo passes NUR checks
This commit is contained in:
parent
7aa0c5e3ea
commit
9b3ee537a8
16
flake.nix
16
flake.nix
|
@ -276,6 +276,22 @@
|
||||||
type = "app";
|
type = "app";
|
||||||
program = ''${deployScript "switch"}'';
|
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 = {
|
templates = {
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
# ^ source: <https://github.com/nix-community/nur-packages-template/blob/master/.github/workflows/build.yml#L63>
|
# ^ 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),
|
# 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)
|
# 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.
|
# 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>
|
# - CI logs: <https://github.com/nix-community/NUR/actions/workflows/update.yml>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user