tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/hledger-web: set capabilites as boolean
Justin Humm
5 years ago
347a9168
569940b9
+28
-6
2 changed files
expand all
collapse all
unified
split
nixos
modules
services
web-apps
hledger-web.nix
tests
hledger-web.nix
+27
-6
nixos/modules/services/web-apps/hledger-web.nix
···
26
26
'';
27
27
};
28
28
29
29
-
capabilities = mkOption {
30
30
-
type = types.commas;
31
31
-
default = "view";
32
32
-
description = ''
33
33
-
Enable the view, add, and/or manage capabilities. E.g. view,add
34
34
-
'';
29
29
+
capabilities = {
30
30
+
view = mkOption {
31
31
+
type = types.bool;
32
32
+
default = true;
33
33
+
description = ''
34
34
+
Enable the view capability.
35
35
+
'';
36
36
+
};
37
37
+
add = mkOption {
38
38
+
type = types.bool;
39
39
+
default = false;
40
40
+
description = ''
41
41
+
Enable the add capability.
42
42
+
'';
43
43
+
};
44
44
+
manage = mkOption {
45
45
+
type = types.bool;
46
46
+
default = false;
47
47
+
description = ''
48
48
+
Enable the manage capability.
49
49
+
'';
50
50
+
};
35
51
};
36
52
37
53
stateDir = mkOption {
···
86
102
users.groups.hledger = {};
87
103
88
104
systemd.services.hledger-web = let
105
105
+
capabilityString = with cfg.capabilities; concatStringsSep "," (
106
106
+
(optional view "view")
107
107
+
++ (optional add "add")
108
108
+
++ (optional manage "manage")
109
109
+
);
89
110
serverArgs = with cfg; escapeShellArgs ([
90
111
"--serve"
91
112
"--host=${host}"
+1
nixos/tests/hledger-web.nix
···
19
19
host = "127.0.0.1";
20
20
port = 5000;
21
21
enable = true;
22
22
+
capabilities.manage = true;
22
23
};
23
24
networking.firewall.allowedTCPPorts = [ config.services.hledger-web.port ];
24
25
systemd.services.hledger-web.preStart = ''