fix: move dns configuration into module
This commit is contained in:
@@ -26,14 +26,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
networking.hostName = meta.hostname;
|
networking.hostName = meta.hostname;
|
||||||
networking.networkmanager = {
|
|
||||||
enable = true;
|
|
||||||
dns = "systemd-resolved";
|
|
||||||
};
|
|
||||||
# networking.search = [
|
|
||||||
# "service.consul"
|
|
||||||
# "node.consul"
|
|
||||||
# ];
|
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
swapDevices = [
|
swapDevices = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -86,23 +86,6 @@
|
|||||||
services.pcscd.enable = true;
|
services.pcscd.enable = true;
|
||||||
services.udev.packages = with pkgs; [ yubikey-personalization ];
|
services.udev.packages = with pkgs; [ yubikey-personalization ];
|
||||||
|
|
||||||
services.resolved = {
|
|
||||||
enable = true;
|
|
||||||
fallbackDns = [
|
|
||||||
"1.1.1.1"
|
|
||||||
"1.0.0.1"
|
|
||||||
];
|
|
||||||
domains = [
|
|
||||||
"consul"
|
|
||||||
"service.consul"
|
|
||||||
"node.consul"
|
|
||||||
];
|
|
||||||
extraConfig = ''
|
|
||||||
[Resolve]
|
|
||||||
DNS=192.168.20.5:8600
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.neovim = lib.mkDefault {
|
programs.neovim = lib.mkDefault {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultEditor = true;
|
defaultEditor = true;
|
||||||
|
|||||||
@@ -18,5 +18,6 @@
|
|||||||
./virtualization.nix
|
./virtualization.nix
|
||||||
./printing.nix
|
./printing.nix
|
||||||
./sensors.nix
|
./sensors.nix
|
||||||
|
./dns.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
39
nix/modules/dns.nix
Normal file
39
nix/modules/dns.nix
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
options.dns = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "enable dns";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.dns.enable {
|
||||||
|
networking.networkmanager = {
|
||||||
|
enable = true;
|
||||||
|
dns = "systemd-resolved";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.resolved = {
|
||||||
|
enable = true;
|
||||||
|
fallbackDns = [
|
||||||
|
"1.1.1.1"
|
||||||
|
"1.0.0.1"
|
||||||
|
];
|
||||||
|
domains = [
|
||||||
|
"consul"
|
||||||
|
"service.consul"
|
||||||
|
"node.consul"
|
||||||
|
];
|
||||||
|
extraConfig = ''
|
||||||
|
[Resolve]
|
||||||
|
DNS=192.168.20.5:8600
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user