Manual: When building from the channel, link to the exact Git revision
This commit is contained in:
parent
c4149c7b56
commit
d49f141a79
@ -22,6 +22,8 @@ let
|
|||||||
in
|
in
|
||||||
{ inherit trivial lists strings stringsWithDeps attrsets sources options
|
{ inherit trivial lists strings stringsWithDeps attrsets sources options
|
||||||
properties modules types meta debug maintainers licenses platforms systems;
|
properties modules types meta debug maintainers licenses platforms systems;
|
||||||
|
# Pull in some builtins not included elsewhere.
|
||||||
|
inherit (builtins) pathExists readFile;
|
||||||
}
|
}
|
||||||
# !!! don't include everything at top-level; perhaps only the most
|
# !!! don't include everything at top-level; perhaps only the most
|
||||||
# commonly used functions.
|
# commonly used functions.
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
# General list operations.
|
# General list operations.
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (import ./trivial.nix) deepSeq;
|
inherit (import ./trivial.nix) deepSeq;
|
||||||
|
|
||||||
inc = builtins.add 1;
|
inc = builtins.add 1;
|
||||||
|
|
||||||
dec = n: builtins.sub n 1;
|
dec = n: builtins.sub n 1;
|
||||||
|
|
||||||
inherit (builtins) elemAt;
|
|
||||||
in rec {
|
in rec {
|
||||||
inherit (builtins) head tail length isList add sub lessThan;
|
inherit (builtins) head tail length isList add sub lessThan elemAt;
|
||||||
|
|
||||||
|
|
||||||
# Create a list consisting of a single element. `singleton x' is
|
# Create a list consisting of a single element. `singleton x' is
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{ pkgs, options
|
{ pkgs, options
|
||||||
# revision can have multiple values: local, HEAD or any revision number.
|
, revision ? "master"
|
||||||
, revision ? "HEAD"
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
|
@ -29,11 +29,11 @@ with pkgs.lib;
|
|||||||
config = {
|
config = {
|
||||||
|
|
||||||
system.nixosVersion =
|
system.nixosVersion =
|
||||||
mkDefault (builtins.readFile "${toString pkgs.path}/.version" + config.system.nixosVersionSuffix);
|
mkDefault (readFile "${toString pkgs.path}/.version" + config.system.nixosVersionSuffix);
|
||||||
|
|
||||||
system.nixosVersionSuffix =
|
system.nixosVersionSuffix =
|
||||||
let suffixFile = "${toString pkgs.path}/.version-suffix"; in
|
let suffixFile = "${toString pkgs.path}/.version-suffix"; in
|
||||||
mkDefault (if builtins.pathExists suffixFile then builtins.readFile suffixFile else "pre-git");
|
mkDefault (if pathExists suffixFile then readFile suffixFile else "pre-git");
|
||||||
|
|
||||||
# Note: code names must only increase in alphabetical order.
|
# Note: code names must only increase in alphabetical order.
|
||||||
system.nixosCodeName = "Aardvark";
|
system.nixosCodeName = "Aardvark";
|
||||||
|
@ -12,8 +12,10 @@ let
|
|||||||
cfg = config.services.nixosManual;
|
cfg = config.services.nixosManual;
|
||||||
|
|
||||||
manual = import ../../../doc/manual {
|
manual = import ../../../doc/manual {
|
||||||
inherit (cfg) revision;
|
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
revision =
|
||||||
|
let fn = "${toString pkgs.path}/.git-revision";
|
||||||
|
in if pathExists fn then readFile fn else "master";
|
||||||
options = (fixMergeModules baseModules
|
options = (fixMergeModules baseModules
|
||||||
(removeAttrs extraArgs ["config" "options"]) // {
|
(removeAttrs extraArgs ["config" "options"]) // {
|
||||||
modules = [ ];
|
modules = [ ];
|
||||||
@ -75,16 +77,6 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nixosManual.revision = mkOption {
|
|
||||||
default = "local";
|
|
||||||
type = types.uniq types.string;
|
|
||||||
description = ''
|
|
||||||
Revision of the targeted source file. This value can either be
|
|
||||||
<literal>"local"</literal>, <literal>"HEAD"</literal> or any
|
|
||||||
revision number embedded in a string.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,6 +91,7 @@ in {
|
|||||||
distPhase = ''
|
distPhase = ''
|
||||||
rm -rf .git
|
rm -rf .git
|
||||||
echo -n $VERSION_SUFFIX > .version-suffix
|
echo -n $VERSION_SUFFIX > .version-suffix
|
||||||
|
echo -n ${nixpkgs.rev or nixpkgs.shortRev} > .git-revision
|
||||||
releaseName=nixos-$VERSION$VERSION_SUFFIX
|
releaseName=nixos-$VERSION$VERSION_SUFFIX
|
||||||
mkdir -p $out/tarballs
|
mkdir -p $out/tarballs
|
||||||
mkdir ../$releaseName
|
mkdir ../$releaseName
|
||||||
|
Loading…
Reference in New Issue
Block a user