summaryrefslogtreecommitdiff
path: root/modules/nixos/gotify.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2024-03-31 21:29:27 +0300
committerAzat Bahawi <azat@bahawi.net>2024-03-31 21:29:27 +0300
commit9a5427e3a0c0ccf2a82dc503149a26b23fbd6004 (patch)
treef28beec29deeea36038615a8fb98a810891940b5 /modules/nixos/gotify.nix
parent4ad0c3afc1f6caf0c3f05f99a15b22178f2c190b (diff)
2024-03-31
Diffstat (limited to 'modules/nixos/gotify.nix')
-rw-r--r--modules/nixos/gotify.nix22
1 files changed, 14 insertions, 8 deletions
diff --git a/modules/nixos/gotify.nix b/modules/nixos/gotify.nix
index 4bdd4fa..ad9b277 100644
--- a/modules/nixos/gotify.nix
+++ b/modules/nixos/gotify.nix
@@ -4,9 +4,11 @@
libNginx,
...
}:
-with lib; let
+with lib;
+let
cfg = config.nixfiles.modules.gotify;
-in {
+in
+{
options.nixfiles.modules.gotify = {
enable = mkEnableOption "Gotify";
@@ -17,14 +19,15 @@ in {
};
};
- config = let
- db = "gotify";
- in
+ config =
+ let
+ db = "gotify";
+ in
mkIf cfg.enable {
nixfiles.modules = {
nginx = {
enable = true;
- upstreams.gotify.servers."127.0.0.1:${toString config.services.gotify.port}" = {};
+ upstreams.gotify.servers."127.0.0.1:${toString config.services.gotify.port}" = { };
virtualHosts.${cfg.domain} = {
locations."/" = {
proxyPass = "http://gotify";
@@ -50,7 +53,7 @@ in {
};
postgresql = {
- ensureDatabases = [db];
+ ensureDatabases = [ db ];
ensureUsers = [
{
name = db;
@@ -61,7 +64,10 @@ in {
};
systemd.services.gotify-server = {
- after = ["network-online.target" "postgresql.service"];
+ after = [
+ "network-online.target"
+ "postgresql.service"
+ ];
environment = {
GOTIFY_DATABASE_DIALECT = "postgres";
GOTIFY_DATABASE_CONNECTION = concatStringsSep " " [