summary refs log tree commit diff
path: root/nixos/modules/services/databases
diff options
context:
space:
mode:
authorhappysalada <raphael@megzari.com>2023-09-06 06:17:31 -0400
committerYt <happysalada@tuta.io>2023-09-07 08:57:41 +0000
commit5ae2b2751833bece606e0cbc64cfbd4bd331e628 (patch)
treeedade209b8bb4da04aeff283a0faae14e1398629 /nixos/modules/services/databases
parent3d8c6b5b941aeaf98628ba336ecc59caab961021 (diff)
downloadnixpkgs-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar
nixpkgs-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar.gz
nixpkgs-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar.bz2
nixpkgs-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar.lz
nixpkgs-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar.xz
nixpkgs-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar.zst
nixpkgs-5ae2b2751833bece606e0cbc64cfbd4bd331e628.zip
nixos/surrealdb: incorporate beta 10 changes
Diffstat (limited to 'nixos/modules/services/databases')
-rw-r--r--nixos/modules/services/databases/surrealdb.nix29
1 files changed, 7 insertions, 22 deletions
diff --git a/nixos/modules/services/databases/surrealdb.nix b/nixos/modules/services/databases/surrealdb.nix
index 050a5336cb4..28bd97cd731 100644
--- a/nixos/modules/services/databases/surrealdb.nix
+++ b/nixos/modules/services/databases/surrealdb.nix
@@ -47,17 +47,13 @@ in {
         example = 8000;
       };
 
-      userNamePath = mkOption {
-        type = types.path;
+      extraFlags = mkOption {
+        type = types.listOf types.str;
+        default = [];
+        example = [ "--allow-all" "--auth" "--user root" "--pass root" ];
         description = lib.mdDoc ''
-          Path to read the username from.
-        '';
-      };
-
-      passwordPath = mkOption {
-        type = types.path;
-        description = lib.mdDoc ''
-          Path to read the password from.
+          Specify a list of additional command line flags,
+          which get escaped and are then passed to surrealdb.
         '';
       };
     };
@@ -73,19 +69,8 @@ in {
       wantedBy = [ "multi-user.target" ];
       after = [ "network.target" ];
 
-      script = ''
-        ${cfg.package}/bin/surreal start \
-          --user $(${pkgs.systemd}/bin/systemd-creds cat SURREALDB_USERNAME) \
-          --pass $(${pkgs.systemd}/bin/systemd-creds cat SURREALDB_PASSWORD) \
-          --bind ${cfg.host}:${toString cfg.port} \
-          -- ${cfg.dbPath}
-      '';
       serviceConfig = {
-        LoadCredential = [
-          "SURREALDB_USERNAME:${cfg.userNamePath}"
-          "SURREALDB_PASSWORD:${cfg.passwordPath}"
-        ];
-
+        ExecStart = "${cfg.package}/bin/surreal start --bind ${cfg.host}:${toString cfg.port} ${escapeShellArgs cfg.extraFlags} -- ${cfg.dbPath}";
         DynamicUser = true;
         Restart = "on-failure";
         StateDirectory = "surrealdb";