about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/nixery/default.nix20
-rw-r--r--tools/nixery/docs/default.nix8
-rw-r--r--tools/nixery/docs/src/nixery.md10
3 files changed, 25 insertions, 13 deletions
diff --git a/tools/nixery/default.nix b/tools/nixery/default.nix
index 3c9e50cac0cc..1b1715cf9fcc 100644
--- a/tools/nixery/default.nix
+++ b/tools/nixery/default.nix
@@ -19,7 +19,7 @@
 with pkgs;
 
 let
-  inherit (pkgs) buildGoModule;
+  inherit (pkgs) buildGoModule lib;
 
   # Avoid extracting this from git until we have a way to plumb
   # through revision numbers.
@@ -33,7 +33,23 @@ depot.nix.readTree.drvTargets rec {
   # Use mdBook to build a static asset page which Nixery can then
   # serve. This is primarily used for the public instance at
   # nixery.dev.
-  nixery-book = callPackage ./docs { };
+  #
+  # If the nixpkgs commit is known, append it to the main docs page.
+  nixery-book = callPackage ./docs {
+    postamble = lib.optionalString (pkgs ? nixpkgsCommits.unstable) ''
+      ### Which revision of `nixpkgs` is used for the builds?
+
+      The current revision of `nixpkgs` is
+      [`${pkgs.nixpkgsCommits.unstable}`][commit] from the
+      `nixos-unstable` channel.
+
+      This instance of Nixery uses the `nixpkgs` channel pinned by TVL
+      in [`//third_party/sources/sources.json`][sources].
+
+      [commit]: https://github.com/NixOS/nixpkgs/commit/${pkgs.nixpkgsCommits.unstable}
+      [sources]: https://code.tvl.fyi/tree/third_party/sources/sources.json
+    '';
+  };
 
   nixery-popcount = callPackage ./popcount { };
 
diff --git a/tools/nixery/docs/default.nix b/tools/nixery/docs/default.nix
index 876a34dcf152..74409fcfa92f 100644
--- a/tools/nixery/docs/default.nix
+++ b/tools/nixery/docs/default.nix
@@ -7,7 +7,7 @@
 # Some of the documentation is pulled in and included from other
 # sources.
 
-{ fetchFromGitHub, mdbook, runCommand, rustPlatform }:
+{ fetchFromGitHub, mdbook, runCommand, rustPlatform, postamble ? "" }:
 
 let
   nix-1p = fetchFromGitHub {
@@ -17,10 +17,14 @@ let
     sha256 = "1pf9i90gn98vz67h296w5lnwhssk62dc6pij983dff42dbci7lhj";
   };
 in
-runCommand "nixery-book" { } ''
+runCommand "nixery-book"
+{
+  POSTAMBLE = postamble;
+} ''
   mkdir -p $out
   cp -r ${./.}/* .
   chmod -R a+w src
   cp ${nix-1p}/README.md src/nix-1p.md
+  echo "''${POSTAMBLE}" >> src/nixery.md
   ${mdbook}/bin/mdbook build -d $out
 ''
diff --git a/tools/nixery/docs/src/nixery.md b/tools/nixery/docs/src/nixery.md
index d9ba179010f6..0d55cfb545d9 100644
--- a/tools/nixery/docs/src/nixery.md
+++ b/tools/nixery/docs/src/nixery.md
@@ -34,7 +34,7 @@ meta-package that automatically expands to several other packages.
 
 Meta-packages **must** be the first path component if they are used. Currently
 there are only two meta-packages:
-- `shell`, which provides a `bash`-shell with interactive configuration and 
+- `shell`, which provides a `bash`-shell with interactive configuration and
   standard tools like `coreutils`.
 - `arm64`, which provides ARM64 binaries.
 
@@ -53,14 +53,6 @@ Over [on Github][Nixery]. It is licensed under the Apache 2.0 license. Consult
 the documentation entries in the sidebar for information on how to set up your
 own instance of Nixery.
 
-### Which revision of `nixpkgs` is used for the builds?
-
-The instance at `nixery.dev` tracks a recent NixOS channel, currently NixOS
-20.09. The channel is updated several times a day.
-
-Private registries might be configured to track a different channel (such as
-`nixos-unstable`) or even track a git repository with custom packages.
-
 ### Should I depend on `nixery.dev` in production?
 
 While we appreciate the enthusiasm, if you would like to use Nixery in your