caddy
This commit is contained in:
parent
eb5691d342
commit
8f2268782b
@ -53,8 +53,6 @@
|
|||||||
inherit geoip2-tarball;
|
inherit geoip2-tarball;
|
||||||
};
|
};
|
||||||
|
|
||||||
e11sync-module = import ./modules/e11sync e11sync-backend;
|
|
||||||
|
|
||||||
e11sync-static = pkgs.callPackage ./pkgs/e11sync-static.nix {};
|
e11sync-static = pkgs.callPackage ./pkgs/e11sync-static.nix {};
|
||||||
|
|
||||||
e11sync-frontend = pkgs.callPackage ./pkgs/e11sync-frontend.nix {
|
e11sync-frontend = pkgs.callPackage ./pkgs/e11sync-frontend.nix {
|
||||||
@ -64,6 +62,10 @@
|
|||||||
e11sync-backend = pkgs.callPackage ./pkgs/e11sync-backend.nix {
|
e11sync-backend = pkgs.callPackage ./pkgs/e11sync-backend.nix {
|
||||||
inherit geoip-mmdb e11sync-static;
|
inherit geoip-mmdb e11sync-static;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
e11sync-module = import ./modules/e11sync {
|
||||||
|
inherit e11sync-backend e11sync-frontend;
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages = {
|
||||||
inherit geoip-mmdb;
|
inherit geoip-mmdb;
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
e11sync-backend: {
|
{
|
||||||
|
e11sync-backend,
|
||||||
|
e11sync-frontend,
|
||||||
|
}: {
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
@ -22,6 +25,7 @@ e11sync-backend: {
|
|||||||
type = path;
|
type = path;
|
||||||
default = "/var/lib/e11sync-backend/db.sqlite3";
|
default = "/var/lib/e11sync-backend/db.sqlite3";
|
||||||
};
|
};
|
||||||
|
vhost = lib.mkOption {type = str;};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = let
|
config = let
|
||||||
@ -74,5 +78,8 @@ e11sync-backend: {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.caddy.virtualHosts."${cfg.vhost}".extraConfig =
|
||||||
|
builtins.readFile "${e11sync-frontend}";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
10
vm.nix
10
vm.nix
@ -3,6 +3,16 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
migrateOnStart = true;
|
migrateOnStart = true;
|
||||||
secretKeyPath = "unsafe";
|
secretKeyPath = "unsafe";
|
||||||
|
vhost = ":8001";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.caddy = {
|
||||||
|
enable = true;
|
||||||
|
globalConfig = ''
|
||||||
|
http_port 8001
|
||||||
|
auto_https off
|
||||||
|
debug
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
Loading…
Reference in New Issue
Block a user