1
This commit is contained in:
Motiejus Jakštys 2024-01-16 23:50:59 +02:00
parent eb5691d342
commit 8f2268782b
3 changed files with 22 additions and 3 deletions

View File

@ -53,8 +53,6 @@
inherit geoip2-tarball;
};
e11sync-module = import ./modules/e11sync e11sync-backend;
e11sync-static = pkgs.callPackage ./pkgs/e11sync-static.nix {};
e11sync-frontend = pkgs.callPackage ./pkgs/e11sync-frontend.nix {
@ -64,6 +62,10 @@
e11sync-backend = pkgs.callPackage ./pkgs/e11sync-backend.nix {
inherit geoip-mmdb e11sync-static;
};
e11sync-module = import ./modules/e11sync {
inherit e11sync-backend e11sync-frontend;
};
in {
packages = {
inherit geoip-mmdb;

View File

@ -1,4 +1,7 @@
e11sync-backend: {
{
e11sync-backend,
e11sync-frontend,
}: {
config,
lib,
...
@ -22,6 +25,7 @@ e11sync-backend: {
type = path;
default = "/var/lib/e11sync-backend/db.sqlite3";
};
vhost = lib.mkOption {type = str;};
};
config = let
@ -74,5 +78,8 @@ e11sync-backend: {
];
};
};
services.caddy.virtualHosts."${cfg.vhost}".extraConfig =
builtins.readFile "${e11sync-frontend}";
};
}

10
vm.nix
View File

@ -3,6 +3,16 @@
enable = true;
migrateOnStart = true;
secretKeyPath = "unsafe";
vhost = ":8001";
};
services.caddy = {
enable = true;
globalConfig = ''
http_port 8001
auto_https off
debug
'';
};
environment.systemPackages = with pkgs; [