-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendlessh.nix
More file actions
46 lines (44 loc) · 1.01 KB
/
endlessh.nix
File metadata and controls
46 lines (44 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
config,
lib,
inputs,
...
}:
with lib;
let
cfg = config.hosts.endlessh;
in
{
options.hosts.endlessh = {
enable = mkEnableOption "Come join my server";
};
config = mkIf cfg.enable {
age.secrets.geoip.file = "${inputs.secrets}/geoip.age";
services = {
geoipupdate = {
enable = true;
settings = {
EditionIDs = [ "GeoLite2-City" ];
AccountID = 1232114;
LicenseKey = config.age.secrets.geoip.path;
};
};
endlessh-go = {
enable = true;
port = 23;
prometheus = {
enable = true;
};
extraOptions = [
"-geoip_supplier=max-mind-db"
"-max_mind_db=${toString config.services.geoipupdate.settings.DatabaseDirectory}/GeoLite2-City.mmdb"
];
openFirewall = true;
};
};
systemd.services.endlessh-go = {
after = [ "network.target" ];
serviceConfig.BindReadOnlyPaths = [ config.services.geoipupdate.settings.DatabaseDirectory ];
};
};
}