aboutsummaryrefslogtreecommitdiff
path: root/modules/secrets/options.nix
blob: fa53d6f8c54b2bf46f803aab9efd2c26b905ddc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{lib, ...}: let
  inherit (lib) mkOption;
in {
  options = {
    collinux.secrets = lib.mkOption {
      description = "Atribute set of secrets";
      type = lib.types.attrsOf (
        lib.types.submodule ({config, ...}: {
          options = {
            name = mkOption {
              type = lib.types.str;
              default = config._module.args.name;
              internal = true;
            };
            file = mkOption {
              description = "Name of the file in the /run/secrets.d";
              type = lib.types.path;
            };
            mode = mkOption {
              description = "Permissions mode of the decrypted secret in a format understood by chmod";
              type = lib.types.str;
              default = "0400";
            };
            owner = mkOption {
              description = "Owner of the decrypted secret file";
              type = lib.types.str;
              default = "0";
            };
            path = mkOption {
              type = lib.types.str;
              default = "/run/secrets.d/${config.name}";
              description = "Path where the decrypted secret is installed";
            };
          };
        })
      );
      default = {};
    };
  };
}