1

module: clean pkgs1

This commit is contained in:
Motiejus Jakštys 2024-01-20 07:00:26 +02:00
parent 2d03d4af5b
commit b5fb5f0c7e

View File

@ -6,6 +6,7 @@ geoip2-tarball: {
}: let }: let
overlays = import ../../overlays.nix geoip2-tarball; overlays = import ../../overlays.nix geoip2-tarball;
pkgs1 = pkgs.extend (lib.composeManyExtensions overlays); pkgs1 = pkgs.extend (lib.composeManyExtensions overlays);
inherit (pkgs1) e11sync-backend e11sync-frontend;
in { in {
options.e11sync = with lib.types; { options.e11sync = with lib.types; {
enable = lib.mkEnableOption "Enable e11sync"; enable = lib.mkEnableOption "Enable e11sync";
@ -34,7 +35,7 @@ in {
in in
lib.mkIf cfg.enable { lib.mkIf cfg.enable {
environment.systemPackages = [ environment.systemPackages = [
pkgs1.e11sync-backend e11sync-backend
]; ];
systemd.services = { systemd.services = {
@ -59,7 +60,7 @@ in {
StateDirectory = "e11sync-backend"; StateDirectory = "e11sync-backend";
WorkingDirectory = "/var/lib/e11sync-backend"; WorkingDirectory = "/var/lib/e11sync-backend";
KillSignal = "SIGQUIT"; KillSignal = "SIGQUIT";
ExecStart = "${pkgs1.e11sync-backend}/bin/e11sync-backend"; ExecStart = "${e11sync-backend}/bin/e11sync-backend";
MemoryHigh = "1535M"; MemoryHigh = "1535M";
MemoryMax = "4096M"; MemoryMax = "4096M";
@ -71,7 +72,7 @@ in {
ProtectControlGroups = true; ProtectControlGroups = true;
} }
(lib.mkIf cfg.migrateOnStart { (lib.mkIf cfg.migrateOnStart {
ExecStartPre = "${pkgs1.e11sync-backend}/bin/e11sync migrate"; ExecStartPre = "${e11sync-backend}/bin/e11sync migrate";
}) })
(lib.mkIf (cfg.secretKeyPath != "unsafe") { (lib.mkIf (cfg.secretKeyPath != "unsafe") {
LoadCredential = "secret_key:${cfg.secretKeyPath}"; LoadCredential = "secret_key:${cfg.secretKeyPath}";
@ -81,6 +82,6 @@ in {
}; };
services.caddy.virtualHosts."${cfg.vhost}".extraConfig = services.caddy.virtualHosts."${cfg.vhost}".extraConfig =
builtins.readFile "${pkgs1.e11sync-frontend}"; builtins.readFile "${e11sync-frontend}";
}; };
} }