@@ -26,12 +26,28 @@ in {
2626 '';
2727 };
2828
29− capabilities = mkOption {
30− type = types.commas;
31− default = "view";
32− description = ''
33− Enable the view, add, and/or manage capabilities. E.g. view,add
34− '';
29+ capabilities = {
30+ view = mkOption {
31+ type = types.bool;
32+ default = true;
33+ description = ''
34+ Enable the view capability.
35+ '';
36+ };
37+ add = mkOption {
38+ type = types.bool;
39+ default = false;
40+ description = ''
41+ Enable the add capability.
42+ '';
43+ };
44+ manage = mkOption {
45+ type = types.bool;
46+ default = false;
47+ description = ''
48+ Enable the manage capability.
49+ '';
50+ };
3551 };
3652
3753 stateDir = mkOption {
@@ -86,6 +102,11 @@ in {
86102 users.groups.hledger = {};
87103
88104 systemd.services.hledger-web = let
105+ capabilityString = with cfg.capabilities; concatStringsSep "," (
106+ (optional view "view")
107+ ++ (optional add "add")
108+ ++ (optional manage "manage")
109+ );
89110 serverArgs = with cfg; escapeShellArgs ([
90111 "--serve"
91112 "--host=${host}"