From ef1077013b863132e7429e946d221b4c810b5f53 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Thu, 29 May 2025 16:32:19 +0200 Subject: [PATCH] workflows/manual-nixpkgs: build nixpkgs manual on staging and stable branches By using the pinned nixpkgs we have for CI, we can lift the restriction of building the nixpkgs manual only in PRs targeting master. At the same time, this uses the pinned nixpkgs for the doc/ folder's dev shell. This allows entering that shell while working on a staging-based branch and write documentation. Why should staging be un(der)documented, after all? Note: The package that is available in nixpkgs as pkgs.nixpkgs-manual will still be built with the current nixpkgs checkout, not the pinned version. This is the same that hydra builds. --- .github/workflows/manual-nixpkgs-v2.yml | 4 +--- ci/default.nix | 4 ++-- doc/default.nix | 4 ++-- doc/shell.nix | 8 +------- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/manual-nixpkgs-v2.yml b/.github/workflows/manual-nixpkgs-v2.yml index 13949dd3c36e..c6af1f14b34e 100644 --- a/.github/workflows/manual-nixpkgs-v2.yml +++ b/.github/workflows/manual-nixpkgs-v2.yml @@ -5,8 +5,6 @@ on: paths: - .github/workflows/manual-nixpkgs-v2.yml pull_request_target: - branches: - - master paths: - 'doc/**' - 'lib/**' @@ -38,4 +36,4 @@ jobs: authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Building Nixpkgs manual - run: NIX_PATH=nixpkgs=$(pwd)/untrusted nix-build --option restrict-eval true untrusted/ci -A manual-nixpkgs -A manual-nixpkgs-tests + run: nix-build untrusted/ci -A manual-nixpkgs -A manual-nixpkgs-tests diff --git a/ci/default.nix b/ci/default.nix index 939e8411d27a..94d049903fca 100644 --- a/ci/default.nix +++ b/ci/default.nix @@ -82,8 +82,8 @@ in # CI jobs lib-tests = import ../lib/tests/release.nix { inherit pkgs; }; manual-nixos = (import ../nixos/release.nix { }).manual.${system} or null; - manual-nixpkgs = (import ../pkgs/top-level/release.nix { }).manual; - manual-nixpkgs-tests = (import ../pkgs/top-level/release.nix { }).manual.tests; + manual-nixpkgs = (import ../doc { }); + manual-nixpkgs-tests = (import ../doc { }).tests; nixpkgs-vet = pkgs.callPackage ./nixpkgs-vet.nix { }; parse = pkgs.lib.recurseIntoAttrs { latest = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.latest; }; diff --git a/doc/default.nix b/doc/default.nix index 2c9a0439feb5..7e2d0df152cc 100644 --- a/doc/default.nix +++ b/doc/default.nix @@ -1,6 +1,6 @@ { - pkgs ? (import ./.. { }), + pkgs ? (import ../ci { }).pkgs, nixpkgs ? { }, }: -pkgs.nixpkgs-manual.override { inherit nixpkgs; } +pkgs.callPackage ./doc-support/package.nix { inherit nixpkgs; } diff --git a/doc/shell.nix b/doc/shell.nix index 3aad697742b2..fbd4670b9465 100644 --- a/doc/shell.nix +++ b/doc/shell.nix @@ -1,7 +1 @@ -let - pkgs = import ../. { - config = { }; - overlays = [ ]; - }; -in -pkgs.nixpkgs-manual.shell +(import ./default.nix { }).shell