1

rename e11sync-frontend -> e11sync-caddyfile

This commit is contained in:
Motiejus Jakštys 2024-01-20 14:10:33 +02:00
parent b3da3c8294
commit 34ba024d56
5 changed files with 9 additions and 9 deletions

View File

@ -17,7 +17,7 @@ run-backend:
.PHONY: run-frontend .PHONY: run-frontend
run-frontend: run-frontend:
nix run .#e11sync-frontend nix run .#e11sync-caddyfile
.PHONY: vm .PHONY: vm
vm: vm:

View File

@ -44,7 +44,7 @@
}; };
in { in {
packages = { packages = {
inherit (pkgs) e11sync-static e11sync-frontend e11sync-backend; inherit (pkgs) e11sync-static e11sync-caddyfile e11sync-backend;
}; };
checks = { checks = {
@ -66,9 +66,9 @@
}; };
apps = { apps = {
e11sync-frontend = { e11sync-caddyfile = {
type = "app"; type = "app";
name = "e11sync-frontend"; name = "e11sync-caddyfile";
program = toString (pkgs.writeShellScript "wrapper" '' program = toString (pkgs.writeShellScript "wrapper" ''
exec ${pkgs.caddy}/bin/caddy run --config ${pkgs.writeTextFile { exec ${pkgs.caddy}/bin/caddy run --config ${pkgs.writeTextFile {
name = "Caddyfile"; name = "Caddyfile";
@ -79,7 +79,7 @@
debug debug
} }
:8001 :8001
${builtins.readFile "${pkgs.e11sync-frontend}"} ${builtins.readFile "${pkgs.e11sync-caddyfile}"}
''; '';
}} --adapter caddyfile''); }} --adapter caddyfile'');
}; };

View File

@ -6,7 +6,7 @@ geoip2-tarball: {
}: let }: let
overlay = import ../../overlays.nix geoip2-tarball; overlay = import ../../overlays.nix geoip2-tarball;
pkgs1 = pkgs.extend overlay; pkgs1 = pkgs.extend overlay;
inherit (pkgs1) e11sync-backend e11sync-frontend; inherit (pkgs1) e11sync-backend e11sync-caddyfile;
in { in {
options.e11sync = with lib.types; { options.e11sync = with lib.types; {
enable = lib.mkEnableOption "Enable e11sync"; enable = lib.mkEnableOption "Enable e11sync";
@ -82,6 +82,6 @@ in {
}; };
services.caddy.virtualHosts."${cfg.vhost}".extraConfig = services.caddy.virtualHosts."${cfg.vhost}".extraConfig =
builtins.readFile "${e11sync-frontend}"; builtins.readFile "${e11sync-caddyfile}";
}; };
} }

View File

@ -13,6 +13,6 @@ in {
inherit geoip2-tarball; inherit geoip2-tarball;
}; };
e11sync-static = withDjango5.callPackage ./pkgs/e11sync-static.nix {}; e11sync-static = withDjango5.callPackage ./pkgs/e11sync-static.nix {};
e11sync-frontend = withDjango5.callPackage ./pkgs/e11sync-frontend.nix {}; e11sync-caddyfile = withDjango5.callPackage ./pkgs/e11sync-caddyfile.nix {};
e11sync-backend = withDjango5.callPackage ./pkgs/e11sync-backend.nix {}; e11sync-backend = withDjango5.callPackage ./pkgs/e11sync-backend.nix {};
}) })

View File

@ -4,7 +4,7 @@
backendPort ? 8002, backendPort ? 8002,
}: }:
writeTextFile { writeTextFile {
name = "e11sync-frontend"; name = "e11sync-caddyfile";
text = '' text = ''
header /static/CACHE/* Cache-Control "public, max-age=31536000, immutable" header /static/CACHE/* Cache-Control "public, max-age=31536000, immutable"