diff options
author | Justin Humm <justin.humm@posteo.de> | 2021-03-12 22:09:51 +0100 |
---|---|---|
committer | erictapen <justin.humm@posteo.de> | 2021-03-26 13:45:13 +0100 |
commit | 347a9168aee712703b6add4933164f2a0d8b41f8 (patch) | |
tree | aa948ad441aef03656809a8bad44276947ad1f99 | |
parent | 569940b9fd60ea40359a8d8f1bbffd5db31b19c8 (diff) | |
download | nixpkgs-347a9168aee712703b6add4933164f2a0d8b41f8.tar nixpkgs-347a9168aee712703b6add4933164f2a0d8b41f8.tar.gz nixpkgs-347a9168aee712703b6add4933164f2a0d8b41f8.tar.bz2 nixpkgs-347a9168aee712703b6add4933164f2a0d8b41f8.tar.lz nixpkgs-347a9168aee712703b6add4933164f2a0d8b41f8.tar.xz nixpkgs-347a9168aee712703b6add4933164f2a0d8b41f8.tar.zst nixpkgs-347a9168aee712703b6add4933164f2a0d8b41f8.zip |
nixos/hledger-web: set capabilites as boolean
-rw-r--r-- | nixos/modules/services/web-apps/hledger-web.nix | 33 | ||||
-rw-r--r-- | nixos/tests/hledger-web.nix | 1 |
2 files changed, 28 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}" diff --git a/nixos/tests/hledger-web.nix b/nixos/tests/hledger-web.nix index a359917edd7..f8919f7d4bd 100644 --- a/nixos/tests/hledger-web.nix +++ b/nixos/tests/hledger-web.nix @@ -19,6 +19,7 @@ rec { host = "127.0.0.1"; port = 5000; enable = true; + capabilities.manage = true; }; networking.firewall.allowedTCPPorts = [ config.services.hledger-web.port ]; systemd.services.hledger-web.preStart = '' |