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: { |
Skyler Grey | ec13fbd | 2024-08-03 08:11:04 +0000 | [diff] [blame] | 18 | config = lib.optionalAttrs config.clicks.security.secrets.groupPerms.enable { |
| 19 | mode = lib.mkOverride 999 "0440"; |
Skyler Grey | 3637b8a | 2024-08-02 19:01:48 +0000 | [diff] [blame] | 20 | }; |
| 21 | })); |
| 22 | }; |
| 23 | }; |
| 24 | } |