huge change
This commit is contained in:
parent
c159d2f3e3
commit
d86cc3c816
29 changed files with 1151 additions and 792 deletions
57
moduler/services/gotify/default.nix
Normal file
57
moduler/services/gotify/default.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
{
|
||||
options = {
|
||||
gotify = {
|
||||
enable = mkEnableOption "enables gotify";
|
||||
port = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 8857;
|
||||
description = "The port gotify listens on.";
|
||||
};
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
defaultText = literalExpression "127.0.0.1";
|
||||
description = "The hostname that gotify binds to";
|
||||
};
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
defaultText = literalExpression "home.wastring.com";
|
||||
description = "The hostname that gotify binds to";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkMerge [
|
||||
(mkIf config.gotify.enable {
|
||||
sops.secrets.gotify_password = { };
|
||||
|
||||
services.gotify = {
|
||||
enable = true;
|
||||
environmentFiles = [
|
||||
config.sops.secrets.gotify_password.path
|
||||
];
|
||||
environment = {
|
||||
GOTIFY_DATABASE_DIALECT = "sqlite3";
|
||||
GOTIFY_SERVER_PORT = config.gotify.port;
|
||||
GOTIFY_DEFAULTUSER_NAME = "admin";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${config.gotify.domain} = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${toString config.gotify.host}:${toString config.gotify.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue