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
|
||||
;;
|
||||
--hash|--revision)
|
||||
if ! [[ @revision@ =~ /[0-9a-f]+/ ]]; then
|
||||
echo "$0: Nixpkgs commit hash is unknown"
|
||||
exit 1
|
||||
fi
|
||||
echo "@revision@"
|
||||
;;
|
||||
--json)
|
||||
|
|
|
@ -42,8 +42,8 @@ in
|
|||
|
||||
nixos.revision = mkOption {
|
||||
internal = true;
|
||||
type = types.str;
|
||||
default = trivial.revisionWithDefault "master";
|
||||
type = types.nullOr types.str;
|
||||
default = trivial.revisionWithDefault null;
|
||||
description = "The Git revision from which this NixOS configuration was built.";
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue