From f81198f0f222987ca19112963aeabe477374a4c7 Mon Sep 17 00:00:00 2001 From: Clansty Date: Wed, 14 Sep 2022 22:46:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B2=A1=E6=9C=89=20prisma=20db=20push?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nixos/module.nix | 4 ++++ nixos/service.nix | 2 ++ 2 files changed, 6 insertions(+) diff --git a/nixos/module.nix b/nixos/module.nix index dbde5fd..c3b3911 100644 --- a/nixos/module.nix +++ b/nixos/module.nix @@ -19,6 +19,10 @@ with pkgs.lib; type = types.package; default = pkgs.callPackage "${import ./clansty-flake.nix pkgs}/packages/tgs-to-gif" { }; }; + prisma-package = mkOption { + type = types.package; + default = callPackage ./prismaPatched.nix { }; + }; tg.api-id = mkOption { type = types.int; }; diff --git a/nixos/service.nix b/nixos/service.nix index bf6061a..0214d60 100644 --- a/nixos/service.nix +++ b/nixos/service.nix @@ -42,6 +42,8 @@ in serviceConfig = { User = "q2tg"; Group = "q2tg"; + Restart = "on-failure"; + ExecStartPre = "${cfg.prisma-package}/bin/prisma db push --accept-data-loss --skip-generate"; ExecStart = "${cfg.package}/bin/q2tg"; }; };