fix(headscale): build custom config to update it to alpha
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-04-01 01:50:30 -04:00
parent c5898a9a64
commit aa2f5b2906

View file

@ -6,19 +6,14 @@
...
}: let
inherit (builtins) readFile;
inherit (lib) mkAfter mkOption;
inherit (lib) mkAfter mkForce;
inherit (pkgs.writers) writeYAML;
inherit (config.vars) mainUser hostName;
headscale-flake = headscale.packages.${pkgs.system}.headscale;
clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip;
in {
# FIXME: wait for nixpkgs to reach this : https://github.com/juanfont/headscale/commit/94b30abf56ae09d82a1541bbc3d19557914f9b27
options.services.headscale.settings.db_type = mkOption {
type = lib.types.enum ["sqlite" "postgres"];
};
config = {
environment.systemPackages = [headscale-flake];
users.users.${mainUser}.extraGroups = ["headscale"];
@ -28,21 +23,29 @@ in {
services.headscale = {
enable = true;
package = headscale-flake;
};
address = clusterIP;
port = 8085;
settings = {
environment.etc."headscale/config.yaml".source = mkForce (
writeYAML "headscale.yaml" {
server_url = "https://headscale.nelim.org";
ip_prefixes = ["100.64.0.0/10"];
listen_addr = "${clusterIP}:8085";
prefixes = {
v4 = "100.64.0.0/10";
v6 = "fd7a:115c:a1e0::/48";
};
metrics_listen_addr = "127.0.0.1:9090";
grpc_listen_addr = "0.0.0.0:50443";
grpc_allow_insecure = false;
disable_check_updates = true;
ephemeral_node_inactivity_timeout = "30m";
unix_socket = "/run/headscale/headscale.sock";
unix_socket_permission = "0770";
db_type = "sqlite";
db_path = "/var/lib/headscale/db.sqlite";
database = {
type = "sqlite";
sqlite.path = "/var/lib/headscale/db.sqlite";
};
private_key_path = "/var/lib/headscale/private.key";
noise.private_key_path = "/var/lib/headscale/noise_private.key";
@ -57,8 +60,14 @@ in {
nameservers = [caddyIp];
};
log = {
format = "text";
level = "info";
};
derp = {
urls = [];
auto_update_enable = true;
update_frequency = "24h";
server = {
enabled = true;
@ -70,7 +79,6 @@ in {
region_name = "montreal";
};
};
};
};
};
}
);
}