diff options
Diffstat (limited to 'nixos/modules/services/web-apps/hledger-web.nix')
-rw-r--r-- | nixos/modules/services/web-apps/hledger-web.nix | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/nixos/modules/services/web-apps/hledger-web.nix b/nixos/modules/services/web-apps/hledger-web.nix index f0c9b2b6c4c..a69767194c3 100644 --- a/nixos/modules/services/web-apps/hledger-web.nix +++ b/nixos/modules/services/web-apps/hledger-web.nix @@ -26,12 +26,28 @@ in { ''; }; - capabilities = mkOption { - type = types.commas; - default = "view"; - description = '' - Enable the view, add, and/or manage capabilities. E.g. view,add - ''; + capabilities = { + view = mkOption { + type = types.bool; + default = true; + description = '' + Enable the view capability. + ''; + }; + add = mkOption { + type = types.bool; + default = false; + description = '' + Enable the add capability. + ''; + }; + manage = mkOption { + type = types.bool; + default = false; + description = '' + Enable the manage capability. + ''; + }; }; stateDir = mkOption { @@ -86,6 +102,11 @@ in { users.groups.hledger = {}; systemd.services.hledger-web = let + capabilityString = with cfg.capabilities; concatStringsSep "," ( + (optional view "view") + ++ (optional add "add") + ++ (optional manage "manage") + ); serverArgs = with cfg; escapeShellArgs ([ "--serve" "--host=${host}" |