Skyler Grey | 3637b8a | 2024-08-02 19:01:48 +0000 | [diff] [blame] | 1 | { config, lib, ... }: { |
| 2 | options.clicks.security.secrets.groupPerms.enable = lib.mkOption { |
| 3 | description = '' |
| 4 | Enable setting permissions for age secrets to 0440 rather than 0400 by |
| 5 | default, allowing group access |
| 6 | |
| 7 | The default age permissions for secrets block the "group" from accessing |
| 8 | the secret, making that option useless without additionally specifying a |
| 9 | mode |
| 10 | ''; |
| 11 | type = lib.types.bool; |
| 12 | default = config.clicks.security.secrets.enable; |
| 13 | }; |
| 14 | |
| 15 | options.age = { |
| 16 | secrets = lib.mkOption { |
| 17 | type = lib.types.attrsOf (lib.types.submodule (submodule: { |
| 18 | config = { |
| 19 | mode = lib.pipe "0440" [ |
| 20 | (lib.mkOverride 999) |
| 21 | (lib.mkIf config.clicks.security.secrets.groupPerms.enable) |
| 22 | ]; |
| 23 | }; |
| 24 | })); |
| 25 | }; |
| 26 | }; |
| 27 | } |