commit 34ba024d566022c93b8d06bd7c7f3d3df0ffbb7a (tree)
parent b3da3c829466a423ece1ac2c9407f0c1435d66dd
Author: Motiejus Jakštys <motiejus@jakstys.lt>
Date: Sat, 20 Jan 2024 14:10:33 +0200
rename e11sync-frontend -> e11sync-caddyfile
Diffstat:
6 files changed, 29 insertions(+), 29 deletions(-)
diff --git 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
@@ -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
@@ -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
@@ -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-caddyfile.nix b/pkgs/e11sync-caddyfile.nix
@@ -0,0 +1,21 @@
+{
+ writeTextFile,
+ e11sync-static,
+ backendPort ? 8002,
+}:
+writeTextFile {
+ name = "e11sync-caddyfile";
+ text = ''
+ header /static/CACHE/* Cache-Control "public, max-age=31536000, immutable"
+
+ route /static/* {
+ uri strip_prefix /static
+ file_server * {
+ root ${e11sync-static}
+ precompressed br gzip
+ }
+ }
+
+ reverse_proxy http://127.0.0.1:${toString backendPort}
+ '';
+}
diff --git a/pkgs/e11sync-frontend.nix b/pkgs/e11sync-frontend.nix
@@ -1,21 +0,0 @@
-{
- writeTextFile,
- e11sync-static,
- backendPort ? 8002,
-}:
-writeTextFile {
- name = "e11sync-frontend";
- text = ''
- header /static/CACHE/* Cache-Control "public, max-age=31536000, immutable"
-
- route /static/* {
- uri strip_prefix /static
- file_server * {
- root ${e11sync-static}
- precompressed br gzip
- }
- }
-
- reverse_proxy http://127.0.0.1:${toString backendPort}
- '';
-}