diff --git a/Makefile b/Makefile index 618e4fa..4f279c8 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ run-backend: .PHONY: run-frontend run-frontend: - nix run .#e11sync-frontend + nix run .#e11sync-caddyfile .PHONY: vm vm: diff --git a/flake.nix b/flake.nix index b40beb9..81d2b87 100644 --- a/flake.nix +++ b/flake.nix @@ -44,7 +44,7 @@ }; in { packages = { - inherit (pkgs) e11sync-static e11sync-frontend e11sync-backend; + inherit (pkgs) e11sync-static e11sync-caddyfile e11sync-backend; }; checks = { @@ -66,9 +66,9 @@ }; apps = { - e11sync-frontend = { + e11sync-caddyfile = { type = "app"; - name = "e11sync-frontend"; + name = "e11sync-caddyfile"; program = toString (pkgs.writeShellScript "wrapper" '' exec ${pkgs.caddy}/bin/caddy run --config ${pkgs.writeTextFile { name = "Caddyfile"; @@ -79,7 +79,7 @@ debug } :8001 - ${builtins.readFile "${pkgs.e11sync-frontend}"} + ${builtins.readFile "${pkgs.e11sync-caddyfile}"} ''; }} --adapter caddyfile''); }; diff --git a/modules/e11sync/default.nix b/modules/e11sync/default.nix index e94f23e..d4f134b 100644 --- a/modules/e11sync/default.nix +++ b/modules/e11sync/default.nix @@ -6,7 +6,7 @@ geoip2-tarball: { }: let overlay = import ../../overlays.nix geoip2-tarball; pkgs1 = pkgs.extend overlay; - inherit (pkgs1) e11sync-backend e11sync-frontend; + inherit (pkgs1) e11sync-backend e11sync-caddyfile; in { options.e11sync = with lib.types; { enable = lib.mkEnableOption "Enable e11sync"; @@ -82,6 +82,6 @@ in { }; services.caddy.virtualHosts."${cfg.vhost}".extraConfig = - builtins.readFile "${e11sync-frontend}"; + builtins.readFile "${e11sync-caddyfile}"; }; } diff --git a/overlays.nix b/overlays.nix index 124e3aa..3c70982 100644 --- a/overlays.nix +++ b/overlays.nix @@ -13,6 +13,6 @@ in { inherit geoip2-tarball; }; 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 {}; }) diff --git a/pkgs/e11sync-frontend.nix b/pkgs/e11sync-caddyfile.nix similarity index 92% rename from pkgs/e11sync-frontend.nix rename to pkgs/e11sync-caddyfile.nix index 46d1460..0740102 100644 --- a/pkgs/e11sync-frontend.nix +++ b/pkgs/e11sync-caddyfile.nix @@ -4,7 +4,7 @@ backendPort ? 8002, }: writeTextFile { - name = "e11sync-frontend"; + name = "e11sync-caddyfile"; text = '' header /static/CACHE/* Cache-Control "public, max-age=31536000, immutable"