-
Notifications
You must be signed in to change notification settings - Fork 11
/
hm.nix
46 lines (44 loc) · 1.25 KB
/
hm.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
versions: extracted: {
config,
lib,
...
}: let
inherit (lib) types;
cfg = config.programs.firefox;
version =
if (config.programs.firefox.package != null)
then "${config.programs.firefox.package.version}"
else "unknown";
ext = extracted."${cfg.arkenfox.version}";
in {
options.programs.firefox = {
arkenfox = {
enable = lib.mkEnableOption "arkenfox support in profiles";
version = lib.mkOption {
description = "The version of arkenfox user.js used";
type = types.enum versions;
default = "master";
};
};
profiles = lib.mkOption {
type = types.attrsOf (types.submodule ({config, ...}: {
options.arkenfox = lib.mkOption {
description = "Setup arkenfox user.js in profile";
type = import ./type.nix {
extracted = ext;
inherit lib;
};
default = {};
};
config = lib.mkIf cfg.arkenfox.enable {
settings = config.arkenfox.flatSettings;
};
}));
};
};
config = lib.mkIf (cfg.enable && cfg.arkenfox.enable && !(lib.hasPrefix cfg.arkenfox.version version)) {
warnings = [
"Arkenfox version ${cfg.arkenfox.version} does not match Firefox's (${version})"
];
};
}