fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert HelgessonMerge PR #421575790441

master
2.2 KiB83 linesraw
1{ config, lib, ... }:
2
3with lib;
4
5let releaseInfo = lib.importJSON ../../release.json;
6
7in {
8  options = {
9    home.stateVersion = mkOption {
10      type = types.enum [
11        "18.09"
12        "19.03"
13        "19.09"
14        "20.03"
15        "20.09"
16        "21.03"
17        "21.05"
18        "21.11"
19        "22.05"
20        "22.11"
21        "23.05"
22        "23.11"
23      ];
24      description = ''
25        It is occasionally necessary for Home Manager to change
26        configuration defaults in a way that is incompatible with
27        stateful data. This could, for example, include switching the
28        default data format or location of a file.
29
30        The *state version* indicates which default
31        settings are in effect and will therefore help avoid breaking
32        program configurations. Switching to a higher state version
33        typically requires performing some manual steps, such as data
34        conversion or moving files.
35      '';
36    };
37
38    home.version = {
39      full = mkOption {
40        internal = true;
41        readOnly = true;
42        type = types.str;
43        default = let
44          inherit (config.home.version) release revision;
45          suffix =
46            optionalString (revision != null) "+${substring 0 8 revision}";
47        in "${release}${suffix}";
48        example = "22.11+213a0629";
49        description = "The full Home Manager version.";
50      };
51
52      release = mkOption {
53        internal = true;
54        readOnly = true;
55        type = types.str;
56        default = releaseInfo.release;
57        example = "22.11";
58        description = "The Home Manager release.";
59      };
60
61      isReleaseBranch = mkOption {
62        internal = true;
63        readOnly = true;
64        type = types.bool;
65        default = releaseInfo.isReleaseBranch;
66        description = ''
67          Whether the Home Manager version is from a versioned
68          release branch.
69        '';
70      };
71
72      revision = mkOption {
73        internal = true;
74        type = types.nullOr types.str;
75        default = let gitRepo = "${toString ./../..}/.git";
76        in if pathIsGitRepo gitRepo then commitIdFromGitRepo gitRepo else null;
77        description = ''
78          The Git revision from which this Home Manager configuration was built.
79        '';
80      };
81    };
82  };
83}