Skip to content

Commit

Permalink
nixos/headscale: update options for 0.17.0
Browse files Browse the repository at this point in the history
- logLevel was removed in favor of settings.log.level (juanfont/headscale#768)
- a noisePrivateKey option was added as it is now a required setting for
  headscale to run. The legacy privateKey should be deprecated in the
  future. (juanfont/headscale#738)
  • Loading branch information
Misterio77 committed Nov 30, 2022
1 parent f69b63e commit 4c1954c
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions nixos/modules/services/networking/headscale.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,17 @@ in
type = types.path;
default = "${dataDir}/private.key";
description = lib.mdDoc ''
Path to private key file, generated automatically if it does not exist.
Path to legacy TS2019 private key file, generated automatically if it
does not exist. Not used by headscale >= 0.17.0
'';
};

noisePrivateKeyFile = mkOption {
type = types.path;
default = "${dataDir}/noise_private.key";
description = lib.mdDoc ''
Path to noise TS2021 private key file, generated automatically if it
does not exist. Only used by headscale >= 0.17.0
'';
};

Expand Down Expand Up @@ -188,15 +198,6 @@ in
};
};

logLevel = mkOption {
type = types.str;
default = "info";
description = lib.mdDoc ''
headscale log level.
'';
example = "debug";
};

dns = {
nameservers = mkOption {
type = types.listOf types.str;
Expand Down Expand Up @@ -345,13 +346,19 @@ in
};

};

imports = [
(mkRenamedOptionModule [ "services" "headscale" "logLevel" ] [ "services" "headscale" "settings" "log" "level" ])
];

config = mkIf cfg.enable {

services.headscale.settings = {
server_url = mkDefault cfg.serverUrl;
listen_addr = mkDefault "${cfg.address}:${toString cfg.port}";

private_key_path = mkDefault cfg.privateKeyFile;
noise.private_key_path = mkDefault cfg.noisePrivateKeyFile;

derp = {
urls = mkDefault cfg.derp.urls;
Expand All @@ -369,8 +376,6 @@ in
db_type = mkDefault cfg.database.type;
db_path = mkDefault cfg.database.path;

log_level = mkDefault cfg.logLevel;

dns_config = {
nameservers = mkDefault cfg.dns.nameservers;
domains = mkDefault cfg.dns.domains;
Expand Down

0 comments on commit 4c1954c

Please sign in to comment.