diff --git a/helper/update-flake.sh b/helper/update-flake.sh index 939786f..ca48f72 100755 --- a/helper/update-flake.sh +++ b/helper/update-flake.sh @@ -26,11 +26,16 @@ if [[ ${1:-} != -f ]] && ! git diff --quiet ../flake.{nix,lock}; then exit 1 fi +echo "Updating flake 'nixos-search'" +nix flake update ../test/nixos-search +echo + versions=$(nix eval --json -f update-flake.nix versions) ## Uncomment the following to generate a version change message for testing # versions=$(echo "$versions" | sed 's|1|0|g') +echo "Updating main flake" nix flake update .. echo diff --git a/test/nixos-search/flake.lock b/test/nixos-search/flake.lock new file mode 100644 index 0000000..87ec42f --- /dev/null +++ b/test/nixos-search/flake.lock @@ -0,0 +1,44 @@ +{ + "nodes": { + "nixos-search": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1638831015, + "narHash": "sha256-WmCsa6gSY01Yt0wminCbNV8Mn+4iU1OEF5r3YUh6SVs=", + "owner": "nixos", + "repo": "nixos-search", + "rev": "fa5fe2a61c36ed90506af75c19bfaf2f9d537d87", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixos-search", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1631118067, + "narHash": "sha256-tEcFvm3a6ToeBGwHdjfB2mVQwa4LZCZTQYE2LnY3ycA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "09cd65b33c5653d7d2954fef4b9f0e718c899743", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixos-search": "nixos-search" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/test/nixos-search/flake.nix b/test/nixos-search/flake.nix new file mode 100644 index 0000000..f92bf29 --- /dev/null +++ b/test/nixos-search/flake.nix @@ -0,0 +1,9 @@ +# This flake just mirrors input `nixos-search`. +# Because `nixos-search` is a dev-only dependency, we don't add +# it to the main flake. +{ + inputs.nixos-search.url = "github:nixos/nixos-search"; + outputs = { self, nixos-search }: { + inherit (nixos-search) packages; + }; +} diff --git a/test/run-tests.sh b/test/run-tests.sh index c052079..649fd81 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -267,6 +267,18 @@ flake() { nix flake check "$scriptDir/.." } +# Test generating module documentation for search.nixos.org +nixosSearch() { + if ! checkFlakeSupport "nixosSearch"; then return; fi + + if [[ $outLinkPrefix ]]; then + # Add gcroots for flake-info + nix build $scriptDir/nixos-search#flake-info -o "$outLinkPrefix-flake-info" + fi + echo "Running flake-info (nixos-search)" + nix run $scriptDir/nixos-search#flake-info -- flake ../. +} + # A basic subset of tests to keep the total runtime within # manageable bounds (<4 min on desktop systems). # These are also run on the CI server. @@ -300,6 +312,7 @@ all() { buildable examples flake + nixosSearch } # An alias for buildTest