about summary refs log tree commit diff
path: root/ops/nixos/panettone.nix
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2020-07-28T01·30-0400
committerglittershark <grfn@gws.fyi>2020-07-28T01·35+0000
commitd9262bd6c68ddf39cc22c147ecf40867f4ec3fb9 (patch)
treedc1e32ce587fd511a3c111a18898f493299e450c /ops/nixos/panettone.nix
parentb2c34c4ba3ec7e8bf3110c05b31dc909c395e916 (diff)
feat(ops/nixos): Use database password for Panettone r/1502
It appears this didn't even *work* without a password, so we've been
forced into being more secure.

Change-Id: I4ff9d04961a703a85299dafb79e8447b0a933fc1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1491
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'ops/nixos/panettone.nix')
-rw-r--r--ops/nixos/panettone.nix15
1 files changed, 12 insertions, 3 deletions
diff --git a/ops/nixos/panettone.nix b/ops/nixos/panettone.nix
index 3d31d79caf50..c95fb7ffde65 100644
--- a/ops/nixos/panettone.nix
+++ b/ops/nixos/panettone.nix
@@ -15,21 +15,29 @@ in {
 
     dbHost = mkOption {
       description = "Postgresql host to connect to for Panettone";
-      type = types.string;
+      type = types.str;
       default = "localhost";
     };
 
     dbName = mkOption {
       description = "Name of the database for Panettone";
-      type = types.string;
+      type = types.str;
       default = "panettone";
     };
 
     dbUser = mkOption {
       description = "Name of the database user for Panettone";
-      type = types.string;
+      type = types.str;
       default = "panettone";
     };
+
+    secretsFile = mkOption {
+      description = ''
+        Path to a file containing secrets, in the format accepted
+        by systemd's EnvironmentFile
+      '';
+      type = types.str;
+    };
   };
 
   config = lib.mkIf cfg.enable {
@@ -63,6 +71,7 @@ in {
         DynamicUser = true;
         Restart = "always";
         StateDirectory = "panettone";
+        EnvironmentFile = cfg.secretsFile;
       };
 
       environment = {