diff options
author | Pascal Bach <pascal.bach@nextrem.ch> | 2017-07-08 00:11:44 +0200 |
---|---|---|
committer | Pascal Bach <pascal.bach@nextrem.ch> | 2017-07-09 15:19:50 +0200 |
commit | 0fb8456b1316797cc6cd45814b3250e432eeef77 (patch) | |
tree | a579dca9c63b005e4875b48e22d463af661aec8d /nixos/modules | |
parent | 4cccbc256c3225c1cbfc58faff7149cc59b98be4 (diff) | |
download | nixlib-0fb8456b1316797cc6cd45814b3250e432eeef77.tar nixlib-0fb8456b1316797cc6cd45814b3250e432eeef77.tar.gz nixlib-0fb8456b1316797cc6cd45814b3250e432eeef77.tar.bz2 nixlib-0fb8456b1316797cc6cd45814b3250e432eeef77.tar.lz nixlib-0fb8456b1316797cc6cd45814b3250e432eeef77.tar.xz nixlib-0fb8456b1316797cc6cd45814b3250e432eeef77.tar.zst nixlib-0fb8456b1316797cc6cd45814b3250e432eeef77.zip |
minio service: add additional config options
Set access and secret key and disable browser. Tests extended to do real operations against minio.
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/web-servers/minio.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/nixos/modules/services/web-servers/minio.nix b/nixos/modules/services/web-servers/minio.nix index 1893edf3a776..843f0d986877 100644 --- a/nixos/modules/services/web-servers/minio.nix +++ b/nixos/modules/services/web-servers/minio.nix @@ -29,6 +29,40 @@ in description = "The config directory, for the access keys and other settings."; }; + accessKey = mkOption { + default = ""; + type = types.str; + description = '' + Access key of 5 to 20 characters in length that clients use to access the server. + This overrides the access key that is generated by minio on first startup and stored inside the + <literal>configDir</literal> directory. + ''; + }; + + secretKey = mkOption { + default = ""; + type = types.str; + description = '' + Specify the Secret key of 8 to 40 characters in length that clients use to access the server. + This overrides the secret key that is generated by minio on first startup and stored inside the + <literal>configDir</literal> directory. + ''; + }; + + region = mkOption { + default = "us-east-1"; + type = types.str; + description = '' + The physical location of the server. By default it is set to us-east-1, which is same as AWS S3's and Minio's default region. + ''; + }; + + browser = mkOption { + default = true; + type = types.bool; + description = "Enable or disable access to web UI."; + }; + package = mkOption { default = pkgs.minio; defaultText = "pkgs.minio"; @@ -57,6 +91,14 @@ in Group = "minio"; LimitNOFILE = 65536; }; + environment = { + MINIO_REGION = "${cfg.region}"; + MINIO_BROWSER = "${if cfg.browser then "on" else "off"}"; + } // optionalAttrs (cfg.accessKey != "") { + MINIO_ACCESS_KEY = "${cfg.accessKey}"; + } // optionalAttrs (cfg.secretKey != "") { + MINIO_SECRET_KEY = "${cfg.secretKey}"; + }; }; users.extraUsers.minio = { |