2018-11-22 23:18:29 +00:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2023-07-15 15:47:19 +00:00
|
|
|
let releaseInfo = lib.importJSON ../../release.json;
|
|
|
|
|
|
|
|
in {
|
2018-11-22 23:18:29 +00:00
|
|
|
options = {
|
|
|
|
home.stateVersion = mkOption {
|
2021-06-05 18:05:04 +00:00
|
|
|
type = types.enum [
|
|
|
|
"18.09"
|
|
|
|
"19.03"
|
|
|
|
"19.09"
|
|
|
|
"20.03"
|
|
|
|
"20.09"
|
|
|
|
"21.03"
|
|
|
|
"21.05"
|
|
|
|
"21.11"
|
2021-11-25 16:19:06 +00:00
|
|
|
"22.05"
|
2022-06-01 19:34:23 +00:00
|
|
|
"22.11"
|
2022-11-24 22:13:38 +00:00
|
|
|
"23.05"
|
2023-05-31 16:32:58 +00:00
|
|
|
"23.11"
|
2023-11-27 07:46:43 +00:00
|
|
|
"24.05"
|
2024-05-23 07:07:00 +00:00
|
|
|
"24.11"
|
2021-06-05 18:05:04 +00:00
|
|
|
];
|
2023-07-01 23:45:18 +00:00
|
|
|
description = ''
|
2018-11-22 23:18:29 +00:00
|
|
|
It is occasionally necessary for Home Manager to change
|
|
|
|
configuration defaults in a way that is incompatible with
|
|
|
|
stateful data. This could, for example, include switching the
|
|
|
|
default data format or location of a file.
|
2023-06-30 23:30:13 +00:00
|
|
|
|
|
|
|
The *state version* indicates which default
|
2018-11-22 23:18:29 +00:00
|
|
|
settings are in effect and will therefore help avoid breaking
|
|
|
|
program configurations. Switching to a higher state version
|
|
|
|
typically requires performing some manual steps, such as data
|
|
|
|
conversion or moving files.
|
|
|
|
'';
|
|
|
|
};
|
2022-10-28 20:51:35 +00:00
|
|
|
|
|
|
|
home.version = {
|
|
|
|
full = mkOption {
|
|
|
|
internal = true;
|
|
|
|
readOnly = true;
|
|
|
|
type = types.str;
|
|
|
|
default = let
|
|
|
|
inherit (config.home.version) release revision;
|
|
|
|
suffix =
|
|
|
|
optionalString (revision != null) "+${substring 0 8 revision}";
|
|
|
|
in "${release}${suffix}";
|
2022-12-02 10:49:58 +00:00
|
|
|
example = "22.11+213a0629";
|
2023-07-01 23:45:18 +00:00
|
|
|
description = "The full Home Manager version.";
|
2022-10-28 20:51:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
release = mkOption {
|
|
|
|
internal = true;
|
|
|
|
readOnly = true;
|
|
|
|
type = types.str;
|
2023-07-15 15:47:19 +00:00
|
|
|
default = releaseInfo.release;
|
2022-12-02 10:49:58 +00:00
|
|
|
example = "22.11";
|
2023-07-01 23:45:18 +00:00
|
|
|
description = "The Home Manager release.";
|
2022-10-28 20:51:35 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 15:47:19 +00:00
|
|
|
isReleaseBranch = mkOption {
|
|
|
|
internal = true;
|
|
|
|
readOnly = true;
|
|
|
|
type = types.bool;
|
|
|
|
default = releaseInfo.isReleaseBranch;
|
2023-07-01 23:45:18 +00:00
|
|
|
description = ''
|
2023-07-15 15:47:19 +00:00
|
|
|
Whether the Home Manager version is from a versioned
|
|
|
|
release branch.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2022-10-28 20:51:35 +00:00
|
|
|
revision = mkOption {
|
|
|
|
internal = true;
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = let gitRepo = "${toString ./../..}/.git";
|
|
|
|
in if pathIsGitRepo gitRepo then commitIdFromGitRepo gitRepo else null;
|
2023-07-01 23:45:18 +00:00
|
|
|
description = ''
|
2022-10-28 20:51:35 +00:00
|
|
|
The Git revision from which this Home Manager configuration was built.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2018-11-22 23:18:29 +00:00
|
|
|
};
|
|
|
|
}
|