Fix tailscale magic DNS
This commit is contained in:
parent
8c0e218639
commit
4feb1095ed
3 changed files with 14 additions and 5 deletions
|
@ -27,6 +27,7 @@
|
|||
sane-defaults = {
|
||||
enable = lib.mkDefault true;
|
||||
allSshKeys = config.assets.sshKeys.user;
|
||||
tailnet = "discus-macaroni.ts.net";
|
||||
};
|
||||
flake-qol = {
|
||||
enable = true;
|
||||
|
|
|
@ -37,11 +37,15 @@ in {
|
|||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
# When NetworkManager isn't in use, add tailscale DNS address manually
|
||||
networking.nameservers = lib.mkIf (!nmEnabled && config.services.tailscale.enable) [
|
||||
"100.100.100.100"
|
||||
"1.1.1.1"
|
||||
"1.0.0.1"
|
||||
];
|
||||
networking = lib.mkIf (!nmEnabled && config.services.tailscale.enable && cfg.tailnet != null) {
|
||||
nameservers = [
|
||||
"100.100.100.100"
|
||||
"1.1.1.1"
|
||||
"1.0.0.1"
|
||||
];
|
||||
search = [cfg.tailnet];
|
||||
};
|
||||
|
||||
# NetworkManager probably means desktop system so we don't want to slow down boot times
|
||||
systemd.services = lib.mkIf nmEnabled {
|
||||
NetworkManager-wait-online.enable = false;
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
type = types.attrsOf types.singleLineStr;
|
||||
default = {};
|
||||
};
|
||||
tailnet = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settei.sane-defaults.enable (let
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue