nixos.revision: Use null instead of "master"
"master" is not a valid SHA-1 commit hash, and it's not even necessarily the branch used. 'nixos-version --revision' now returns an error if the commit hash is not known.
This commit is contained in:
parent
b98ea45608
commit
c05cc615f2
@ -6,6 +6,10 @@ case "$1" in
|
|||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
--hash|--revision)
|
--hash|--revision)
|
||||||
|
if ! [[ @revision@ =~ /[0-9a-f]+/ ]]; then
|
||||||
|
echo "$0: Nixpkgs commit hash is unknown"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo "@revision@"
|
echo "@revision@"
|
||||||
;;
|
;;
|
||||||
--json)
|
--json)
|
||||||
|
@ -42,8 +42,8 @@ in
|
|||||||
|
|
||||||
nixos.revision = mkOption {
|
nixos.revision = mkOption {
|
||||||
internal = true;
|
internal = true;
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
default = trivial.revisionWithDefault "master";
|
default = trivial.revisionWithDefault null;
|
||||||
description = "The Git revision from which this NixOS configuration was built.";
|
description = "The Git revision from which this NixOS configuration was built.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user