1
0
Fork 0
nix-config/modules/nixos/services/ente-auth/default.nix
Philipp a044d5707a
fix(ente-auth): remove build flag from ente-web-auth package
Move the build flag from the package to the module, that way everyone
can just define their own URL in the module.
2025-05-31 17:54:25 +02:00

66 lines
1.3 KiB
Nix

{
lib,
pkgs,
config,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.services.ente-auth;
enteApp =
cfg.package.override {
extraBuildEnv = {
NEXT_PUBLIC_ENTE_ENDPOINT = "https://ente-api.monapona.dev";
NEXT_TELEMETRY_DISABLED = "1";
};
};
in
{
options.${namespace}.services.ente-auth = {
enable = mkEnableOption "Ente-Auth";
package = mkOption {
description = "The package of Ente-Auth to use.";
type = types.package;
default = pkgs.awesome-flake.ente-web-auth;
};
domain = mkOption {
description = "The domain to serve ente-auth on.";
type = types.nullOr types.str;
default = "ente.stahl.sh";
};
nginx = {
enable = mkEnableOption "Enable nginx for this service." // {
default = true;
};
};
};
config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = mkIf cfg.nginx.enable [
80
443
];
awesome-flake.services.acme.enable = mkIf cfg.nginx.enable true;
services.nginx = mkIf cfg.nginx.enable {
enable = true;
virtualHosts."${cfg.domain}" = {
forceSSL = true;
useACMEHost = "stahl.sh";
locations."/" = {
root = enteApp;
};
};
};
};
}