blob: 8557a3e1069425bc0dc92f0c087098cf04841b22 (
plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
|
{ config, pkgs, lib, ... }:
with builtins // lib;
let
cfg = config.kfmon;
ini = pkgs.formats.ini {};
in {
options.kfmon = {
enable = mkEnableOption "KFMon";
package = mkPackageOption pkgs "kfmon" {};
path = mkOption {
type = types.str;
readOnly = true;
internal = true;
default = ".adds/kfmon";
};
devicePath = mkOption {
type = types.str;
readOnly = true;
internal = true;
default = "/mnt/onboard/${cfg.path}";
};
file = mkOption {
default = {};
type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {}));
};
_allFiles = mkOption {
type = types.package;
internal = true;
readOnly = true;
default = (pkgs.callPackage ../lib/merge-files.nix {}) (attrValues file);
};
configs = mkOption {
type = types.attrsOf ini.type;
default = {};
description = ''
KFMon .ini config files. Do not touch this unless you know what you're doing!
'';
};
};
config = {
kfmon.file = mapAttrs' (n: v: {
name = "kfmon-config-${n}";
value = {
text = generators.toINI {} v;
target =
let
fixedN = if isSuffix ".ini" n then n else "${n}.ini";
in "config/${fixedN}";
};
});
};
};
|