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"; }; };