masive rewriting and setup of server files
This commit is contained in:
@@ -1,26 +1,30 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
proxyReverse,
|
||||
setup,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.servers.shiori;
|
||||
in
|
||||
{
|
||||
disabledModules = [ "services/web-apps/shiori.nix" ];
|
||||
imports = [ ../../pkgs/shiori/shiori-service.nix ];
|
||||
options.my.servers.shiori.enable = lib.mkEnableOption "enable";
|
||||
imports = [ ../../pkgs/shiori-service.nix ];
|
||||
options.my.servers.shiori = setup.mkOptions "shiori" "bookmarks" 4368;
|
||||
config = lib.mkIf (config.my.servers.shiori.enable && config.my.servers.postgres.enable) {
|
||||
sops.secrets.shiori.sopsFile = ../../secrets/env.yaml;
|
||||
networking.firewall.allowedTCPPorts = lib.mkIf (!cfg.isLocal) [ cfg.port ];
|
||||
sops.secrets = lib.mkIf cfg.enable { shiori.sopsFile = ../../secrets/env.yaml; };
|
||||
services = {
|
||||
shiori = {
|
||||
shiori = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
port = 4368;
|
||||
package = pkgs.callPackage ../../pkgs/shiori/shiori.nix { };
|
||||
inherit (cfg) port;
|
||||
environmentFile = config.sops.secrets.shiori.path;
|
||||
databaseUrl = "postgres:///shiori?host=${config.my.postgresSocket}";
|
||||
};
|
||||
nginx.virtualHosts."bookmarks.${config.my.domain}" =
|
||||
proxyReverse config.services.shiori.port // { };
|
||||
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (
|
||||
proxyReverse cfg.hostName cfg.port // { }
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user