Update derp

This commit is contained in:
albert 2024-03-22 14:12:01 +09:00
parent ccdd96b6ba
commit 6da3a12e76
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
2 changed files with 6 additions and 89 deletions

View file

@ -1,5 +1,5 @@
# Auto-generated using compose2nix v0.1.7.
{ pkgs, lib, ... }: {
{ ... }: {
services.cron = {
enable = true;
systemCronJobs = [
@ -14,55 +14,18 @@
DERP_ADDR = ":1443";
DERP_CERT_DIR = "/app/certs";
DERP_CERT_MODE = "manual";
DERP_DOMAIN = "milan.sysctl.io";
DERP_DOMAIN = "sysctl.io";
DERP_STUN = "true";
DERP_VERIFY_CLIENTS = "true";
};
volumes = [
"/Storage/Data/Docker/sysctl.io/letsencrypt/external/certificates/certs/*.sysctl.io.crt:/app/certs/milan.sysctl.io.crt:ro"
"/Storage/Data/Docker/sysctl.io/letsencrypt/external/certificates/private/*.sysctl.io.key:/app/certs/milan.sysctl.io.key:ro"
"/Storage/Data/Docker/sysctl.io/letsencrypt/external/certificates/certs/*.sysctl.io.crt:/app/certs/sysctl.io.crt:ro"
"/Storage/Data/Docker/sysctl.io/letsencrypt/external/certificates/private/*.sysctl.io.key:/app/certs/sysctl.io.key:ro"
];
ports = [
"3478:3478/udp"
"1443:1443/tcp"
];
log-driver = "journald";
extraOptions = [
"--network-alias=headscale-derp"
"--network=headscale-default"
];
};
systemd.services."docker-headscale-derp" = {
serviceConfig = {
Restart = lib.mkOverride 500 "always";
};
after = [ "docker-network-headscale-default.service" ];
requires = [ "docker-network-headscale-default.service" ];
partOf = [ "docker-compose-headscale-root.target" ];
wantedBy = [ "docker-compose-headscale-root.target" ];
};
# Networks
systemd.services."docker-network-headscale-default" = {
path = [ pkgs.docker ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStop = "${pkgs.docker}/bin/docker network rm -f headscale-default";
};
script = ''
docker network inspect headscale-default || docker network create headscale-default --opt isolate=true
'';
partOf = [ "docker-compose-headscale-root.target" ];
wantedBy = [ "docker-compose-headscale-root.target" ];
};
# Root service
# When started, this will automatically create all resources and start
# the containers. When stopped, this will teardown all resources.
systemd.targets."docker-compose-headscale-root" = {
unitConfig = {
Description = "Root target generated by compose2nix.";
};
wantedBy = [ "multi-user.target" ];
};
}

View file

@ -1,5 +1,5 @@
# Auto-generated using compose2nix v0.1.7.
{ pkgs, lib, ... }: {
{ ... }: {
services.cron = {
enable = true;
systemCronJobs = [
@ -27,51 +27,5 @@
"1443:1443/tcp"
];
log-driver = "journald";
extraOptions = [
"--network-alias=headscale-derp"
"--network=headscale-default"
];
};
systemd.services."docker-headscale-derp" = {
serviceConfig = {
Restart = lib.mkOverride 500 "always";
};
after = [
"docker-network-headscale-default.service"
];
requires = [
"docker-network-headscale-default.service"
];
partOf = [
"docker-compose-headscale-root.target"
];
wantedBy = [
"docker-compose-headscale-root.target"
];
};
# Networks
systemd.services."docker-network-headscale-default" = {
path = [ pkgs.docker ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStop = "${pkgs.docker}/bin/docker network rm -f headscale-default";
};
script = ''
docker network inspect headscale-default || docker network create headscale-default --opt isolate=true
'';
partOf = [ "docker-compose-headscale-root.target" ];
wantedBy = [ "docker-compose-headscale-root.target" ];
};
# Root service
# When started, this will automatically create all resources and start
# the containers. When stopped, this will teardown all resources.
systemd.targets."docker-compose-headscale-root" = {
unitConfig = {
Description = "Root target generated by compose2nix.";
};
wantedBy = [ "multi-user.target" ];
};
}