diff options
author | happysalada <raphael@megzari.com> | 2023-09-06 06:17:31 -0400 |
---|---|---|
committer | Yt <happysalada@tuta.io> | 2023-09-07 08:57:41 +0000 |
commit | 5ae2b2751833bece606e0cbc64cfbd4bd331e628 (patch) | |
tree | edade209b8bb4da04aeff283a0faae14e1398629 /nixos/modules/services | |
parent | 3d8c6b5b941aeaf98628ba336ecc59caab961021 (diff) | |
download | nixlib-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar nixlib-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar.gz nixlib-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar.bz2 nixlib-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar.lz nixlib-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar.xz nixlib-5ae2b2751833bece606e0cbc64cfbd4bd331e628.tar.zst nixlib-5ae2b2751833bece606e0cbc64cfbd4bd331e628.zip |
nixos/surrealdb: incorporate beta 10 changes
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/databases/surrealdb.nix | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/nixos/modules/services/databases/surrealdb.nix b/nixos/modules/services/databases/surrealdb.nix index 050a5336cb4c..28bd97cd731e 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"; |