2018-11-23 00:18:29 +01:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2023-07-15 17:47:19 +02:00
|
|
|
let releaseInfo = lib.importJSON ../../release.json;
|
|
|
|
|
|
|
|
in {
|
2018-11-23 00:18:29 +01:00
|
|
|
options = {
|
|
|
|
home.stateVersion = mkOption {
|
2021-06-05 20:05:04 +02:00
|
|
|
type = types.enum [
|
|
|
|
"18.09"
|
|
|
|
"19.03"
|
|
|
|
"19.09"
|
|
|
|
"20.03"
|
|
|
|
"20.09"
|
|
|
|
"21.03"
|
|
|
|
"21.05"
|
|
|
|
"21.11"
|
2021-11-25 17:19:06 +01:00
|
|
|
"22.05"
|
2022-06-01 21:34:23 +02:00
|
|
|
"22.11"
|
2022-11-24 23:13:38 +01:00
|
|
|
"23.05"
|
2023-05-31 18:32:58 +02:00
|
|
|
"23.11"
|
2023-11-27 08:46:43 +01:00
|
|
|
"24.05"
|
2024-05-23 09:07:00 +02:00
|
|
|
"24.11"
|
2021-06-05 20:05:04 +02:00
|
|
|
];
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2018-11-23 00:18:29 +01: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-07-01 01:30:13 +02:00
|
|
|
|
|
|
|
The *state version* indicates which default
|
2018-11-23 00:18:29 +01: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 22:51:35 +02: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 11:49:58 +01:00
|
|
|
example = "22.11+213a0629";
|
2023-07-02 01:45:18 +02:00
|
|
|
description = "The full Home Manager version.";
|
2022-10-28 22:51:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
release = mkOption {
|
|
|
|
internal = true;
|
|
|
|
readOnly = true;
|
|
|
|
type = types.str;
|
2023-07-15 17:47:19 +02:00
|
|
|
default = releaseInfo.release;
|
2022-12-02 11:49:58 +01:00
|
|
|
example = "22.11";
|
2023-07-02 01:45:18 +02:00
|
|
|
description = "The Home Manager release.";
|
2022-10-28 22:51:35 +02:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:47:19 +02:00
|
|
|
isReleaseBranch = mkOption {
|
|
|
|
internal = true;
|
|
|
|
readOnly = true;
|
|
|
|
type = types.bool;
|
|
|
|
default = releaseInfo.isReleaseBranch;
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2023-07-15 17:47:19 +02:00
|
|
|
Whether the Home Manager version is from a versioned
|
|
|
|
release branch.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2022-10-28 22:51:35 +02: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-02 01:45:18 +02:00
|
|
|
description = ''
|
2022-10-28 22:51:35 +02:00
|
|
|
The Git revision from which this Home Manager configuration was built.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2018-11-23 00:18:29 +01:00
|
|
|
};
|
|
|
|
}
|