mirror of
https://github.com/nix-community/home-manager
synced 2024-11-10 07:04:17 +00:00
version: add isReleaseBranch
This commit is contained in:
parent
1add3c3a99
commit
23ad3d2b53
4 changed files with 28 additions and 4 deletions
|
@ -16,6 +16,13 @@ but could theoretically break
|
||||||
if you have very complex bash expressions in a session variable.
|
if you have very complex bash expressions in a session variable.
|
||||||
Please report any issues you experience.
|
Please report any issues you experience.
|
||||||
|
|
||||||
|
* The `.release` file in the Home Manager source tree
|
||||||
|
has been supplanted by `release.json`,
|
||||||
|
which contains more information about the branch.
|
||||||
|
If you have any external code reading this file,
|
||||||
|
please migrate to using `release.json` instead.
|
||||||
|
The `.release` file will be removed in 24.05.
|
||||||
|
|
||||||
[[sec-release-23.11-state-version-changes]]
|
[[sec-release-23.11-state-version-changes]]
|
||||||
=== State Version Changes
|
=== State Version Changes
|
||||||
|
|
||||||
|
|
|
@ -483,8 +483,8 @@ in
|
||||||
|
|
||||||
warnings =
|
warnings =
|
||||||
let
|
let
|
||||||
hmRelease = fileContents ../.release;
|
hmRelease = config.home.version.release;
|
||||||
nixpkgsRelease = pkgs.lib.trivial.release;
|
nixpkgsRelease = lib.trivial.release;
|
||||||
releaseMismatch =
|
releaseMismatch =
|
||||||
config.home.enableNixpkgsReleaseCheck
|
config.home.enableNixpkgsReleaseCheck
|
||||||
&& hmRelease != nixpkgsRelease;
|
&& hmRelease != nixpkgsRelease;
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
{
|
let releaseInfo = lib.importJSON ../../release.json;
|
||||||
|
|
||||||
|
in {
|
||||||
options = {
|
options = {
|
||||||
home.stateVersion = mkOption {
|
home.stateVersion = mkOption {
|
||||||
type = types.enum [
|
type = types.enum [
|
||||||
|
@ -51,11 +53,22 @@ with lib;
|
||||||
internal = true;
|
internal = true;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = fileContents ../../.release;
|
default = releaseInfo.release;
|
||||||
example = "22.11";
|
example = "22.11";
|
||||||
description = "The Home Manager release.";
|
description = "The Home Manager release.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
isReleaseBranch = mkOption {
|
||||||
|
internal = true;
|
||||||
|
readOnly = true;
|
||||||
|
type = types.bool;
|
||||||
|
default = releaseInfo.isReleaseBranch;
|
||||||
|
description = ''
|
||||||
|
Whether the Home Manager version is from a versioned
|
||||||
|
release branch.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
revision = mkOption {
|
revision = mkOption {
|
||||||
internal = true;
|
internal = true;
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
|
|
4
release.json
Normal file
4
release.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"release": "23.11",
|
||||||
|
"isReleaseBranch": false
|
||||||
|
}
|
Loading…
Reference in a new issue