NixOS/modules/servers/shiori.nix

17 lines
564 B
Nix

{ lib, config, ... }:
let
cfg = config.my.servers.shiori;
setup = import ../factories/mkserver.nix { inherit lib config; };
in
{
options.my.servers.shiori = setup.mkOptions "shiori" "bookmarks" 4368;
config = lib.mkIf (cfg.enable && config.my.servers.postgres.enable && config.my.secureHost) {
sops.secrets.shiori.sopsFile = ../../secrets/env.yaml;
services.shiori = {
inherit (cfg) enable port;
environmentFile = config.sops.secrets.shiori.path;
databaseUrl = "postgres:///shiori?host=${config.my.postgresSocket}";
};
};
}