Skip to content

Commit e9fe624

Browse files
committed
lib/trivial: add manualRevision
This variable is set to "master" on master and "release-YY.DD" on the release branches so that the manual can link to the correct revision.
1 parent 42abb5a commit e9fe624

5 files changed

Lines changed: 11 additions & 9 deletions

File tree

doc/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{ pkgs ? (import ./.. { }), nixpkgs ? { }}:
1+
{ pkgs ? import ./.. { } }:
22
let
33
lib = pkgs.lib;
4-
doc-support = import ./doc-support { inherit pkgs nixpkgs; };
4+
doc-support = import ./doc-support { inherit pkgs; };
55
in pkgs.stdenv.mkDerivation {
66
name = "nixpkgs-manual";
77

doc/doc-support/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{ pkgs ? (import ../.. {}), nixpkgs ? { }}:
1+
{ pkgs ? import ../.. {} }:
22
let
33
inherit (pkgs) lib;
44
inherit (lib) hasPrefix removePrefix;
55

6-
locationsXml = import ./lib-function-locations.nix { inherit pkgs nixpkgs; };
6+
locationsXml = import ./lib-function-locations.nix { inherit pkgs; };
77
functionDocs = import ./lib-function-docs.nix { inherit locationsXml pkgs; };
88
version = pkgs.lib.version;
99

doc/doc-support/lib-function-locations.nix

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
{ pkgs ? (import ./.. { }), nixpkgs ? { }}:
1+
{ pkgs ? import ./.. { } }:
22
let
3-
revision = pkgs.lib.trivial.revisionWithDefault (nixpkgs.revision or "master");
4-
53
libDefPos = set:
64
builtins.map
75
(name: {
@@ -57,7 +55,7 @@ let
5755
[ "'" ]
5856
[ "-prime" ];
5957

60-
urlPrefix = "https://github.com/NixOS/nixpkgs/blob/${revision}";
58+
urlPrefix = "https://github.com/NixOS/nixpkgs/blob/${nixpkgsLib.trivial.manualRevision}";
6159
xmlstrings = (nixpkgsLib.strings.concatMapStrings
6260
({ name, value }:
6361
''

lib/trivial.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ rec {
222222

223223
nixpkgsVersion = builtins.trace "`lib.nixpkgsVersion` is deprecated, use `lib.version` instead!" version;
224224

225+
/* The revision to which the manual should link.
226+
Set this to "release-YY.MM" after branch-off. */
227+
manualRevision = "master";
228+
225229
/* Determine whether the function is being called from inside a Nix
226230
shell.
227231

pkgs/top-level/release.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ let
3535

3636
metrics = import ./metrics.nix { inherit pkgs nixpkgs; };
3737

38-
manual = import ../../doc { inherit pkgs nixpkgs; };
38+
manual = import ../../doc { inherit pkgs; };
3939
lib-tests = import ../../lib/tests/release.nix { inherit pkgs; };
4040
pkgs-lib-tests = import ../pkgs-lib/tests { inherit pkgs; };
4141

0 commit comments

Comments
 (0)