allow specifying backend domain for frontend and remove check for cfg.enable as default for component.enable is cfg.enable
This commit is contained in:
parent
17ca4470ee
commit
8266f2c22a
|
@ -27,6 +27,8 @@
|
|||
jdk = final.openjdk19;
|
||||
};
|
||||
piped-proxy = final.callPackage ./packages/proxy {};
|
||||
piped-proxy-full = piped-proxy.override {withAVIF = true;};
|
||||
piped-proxy-full-openssl = piped-proxy-full.override {withOpenSSL = true;};
|
||||
piped-proxy-openssl = piped-proxy.override {withOpenSSL = true;};
|
||||
piped-proxy-minimal = piped-proxy.override {
|
||||
withAVIF = false;
|
||||
|
@ -51,6 +53,7 @@
|
|||
inherit (pkgs) piped-frontend;
|
||||
inherit (pkgs) piped-backend;
|
||||
inherit (pkgs) piped-proxy piped-proxy-openssl;
|
||||
inherit (pkgs) piped-proxy-full piped-proxy-full-openssl;
|
||||
inherit (pkgs) piped-proxy-minimal piped-proxy-minimal-openssl;
|
||||
};
|
||||
});
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
writeText "config.properties"
|
||||
(cfgToString backendConfigAttrs);
|
||||
in {
|
||||
config = mkIf (cfg.enable && backendConfig.enable) {
|
||||
config = mkIf (backendConfig.enable) {
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /run/piped-backend - piped piped"
|
||||
"f /run/piped-backend/config.properties 660 piped piped"
|
||||
|
|
|
@ -24,7 +24,11 @@ in {
|
|||
type = types.str;
|
||||
description = "Domain where the frontend will be displayed";
|
||||
};
|
||||
|
||||
backendDomain = mkOption {
|
||||
type = types.str;
|
||||
default = cfg.backend.domain;
|
||||
description = "Domain of the backend";
|
||||
};
|
||||
nginx = {
|
||||
forceSSL = mkOption {
|
||||
type = types.bool;
|
||||
|
|
|
@ -7,15 +7,14 @@
|
|||
|
||||
cfg = config.services.piped;
|
||||
|
||||
backendConfig = cfg.backend;
|
||||
frontendConfig = cfg.frontend;
|
||||
nginxConfig = frontendConfig.nginx;
|
||||
|
||||
frontendPackage = frontendConfig.package.override {
|
||||
backendDomain = backendConfig.domain;
|
||||
backendDomain = cfg.backendDomain;
|
||||
};
|
||||
in {
|
||||
config = mkIf (cfg.enable && frontendConfig.enable) {
|
||||
config = mkIf (frontendConfig.enable) {
|
||||
# https://github.com/TeamPiped/Piped/blob/master/docker/nginx.conf
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
access_log off;
|
||||
'';
|
||||
in {
|
||||
config = mkIf (cfg.enable && proxyConfig.enable) {
|
||||
config = mkIf (proxyConfig.enable) {
|
||||
systemd.services.piped-proxy = {
|
||||
wantedBy = ["multi-user.target"];
|
||||
environment.BIND = "0.0.0.0:${toString proxyConfig.internalPort}";
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
withOpenSSL ? false,
|
||||
withMimalloc ? true,
|
||||
withWebP ? true,
|
||||
withAVIF ? true,
|
||||
withAVIF ? false,
|
||||
}: let
|
||||
meta = builtins.fromJSON (builtins.readFile ../../meta.json);
|
||||
rev = meta.proxy.rev;
|
||||
|
|
Loading…
Reference in a new issue