top-level modules: make work
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
nixpkgs: {
|
||||
{
|
||||
nixpkgs,
|
||||
geoip2-tarball,
|
||||
}: {
|
||||
config,
|
||||
lib,
|
||||
system,
|
||||
geoip2-tarball,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
pkgs = import ../../pkgs.nix {inherit nixpkgs system geoip2-tarball;};
|
||||
inherit (pkgs.stdenv.hostPlatform) system;
|
||||
pkgs1 = import ../../pkgs.nix {inherit nixpkgs system geoip2-tarball;};
|
||||
in {
|
||||
options.e11sync = with lib.types; {
|
||||
enable = lib.mkEnableOption "Enable e11sync";
|
||||
@@ -34,7 +37,7 @@ in {
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
pkgs.e11sync-backend
|
||||
pkgs1.e11sync-backend
|
||||
];
|
||||
|
||||
systemd.services = {
|
||||
@@ -59,7 +62,7 @@ in {
|
||||
StateDirectory = "e11sync-backend";
|
||||
WorkingDirectory = "/var/lib/e11sync-backend";
|
||||
KillSignal = "SIGQUIT";
|
||||
ExecStart = "${pkgs.e11sync-backend}/bin/e11sync-backend";
|
||||
ExecStart = "${pkgs1.e11sync-backend}/bin/e11sync-backend";
|
||||
|
||||
MemoryHigh = "1535M";
|
||||
MemoryMax = "4096M";
|
||||
@@ -71,7 +74,7 @@ in {
|
||||
ProtectControlGroups = true;
|
||||
}
|
||||
(lib.mkIf cfg.migrateOnStart {
|
||||
ExecStartPre = "${pkgs.e11sync-backend}/bin/e11sync migrate";
|
||||
ExecStartPre = "${pkgs1.e11sync-backend}/bin/e11sync migrate";
|
||||
})
|
||||
(lib.mkIf (cfg.secretKeyPath != "unsafe") {
|
||||
LoadCredential = "secret_key:${cfg.secretKeyPath}";
|
||||
@@ -81,6 +84,6 @@ in {
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts."${cfg.vhost}".extraConfig =
|
||||
builtins.readFile "${pkgs.e11sync-frontend}";
|
||||
builtins.readFile "${pkgs1.e11sync-frontend}";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user