lol

nixos/hledger-web: set capabilites as boolean

+28 -6
+27 -6
nixos/modules/services/web-apps/hledger-web.nix
··· 26 26 ''; 27 27 }; 28 28 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 + }; 35 51 }; 36 52 37 53 stateDir = mkOption { ··· 86 102 users.groups.hledger = {}; 87 103 88 104 systemd.services.hledger-web = let 105 + capabilityString = with cfg.capabilities; concatStringsSep "," ( 106 + (optional view "view") 107 + ++ (optional add "add") 108 + ++ (optional manage "manage") 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 + capabilities.manage = true; 22 23 }; 23 24 networking.firewall.allowedTCPPorts = [ config.services.hledger-web.port ]; 24 25 systemd.services.hledger-web.preStart = ''