mirror of
https://github.com/nix-community/home-manager
synced 2024-12-21 01:09:47 +01: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.
|
||||
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]]
|
||||
=== State Version Changes
|
||||
|
||||
|
|
|
@ -483,8 +483,8 @@ in
|
|||
|
||||
warnings =
|
||||
let
|
||||
hmRelease = fileContents ../.release;
|
||||
nixpkgsRelease = pkgs.lib.trivial.release;
|
||||
hmRelease = config.home.version.release;
|
||||
nixpkgsRelease = lib.trivial.release;
|
||||
releaseMismatch =
|
||||
config.home.enableNixpkgsReleaseCheck
|
||||
&& hmRelease != nixpkgsRelease;
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
with lib;
|
||||
|
||||
{
|
||||
let releaseInfo = lib.importJSON ../../release.json;
|
||||
|
||||
in {
|
||||
options = {
|
||||
home.stateVersion = mkOption {
|
||||
type = types.enum [
|
||||
|
@ -51,11 +53,22 @@ with lib;
|
|||
internal = true;
|
||||
readOnly = true;
|
||||
type = types.str;
|
||||
default = fileContents ../../.release;
|
||||
default = releaseInfo.release;
|
||||
example = "22.11";
|
||||
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 {
|
||||
internal = true;
|
||||
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