dns configuration with networkmanager

This commit is contained in:
bogale 2026-11-02 00:11:31 +09:00
commit 062f82dbed
3 changed files with 39 additions and 45 deletions

View file

@ -34,7 +34,15 @@
];
i18n.defaultLocale = "ru_RU.UTF-8";
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
networking.networkmanager.enable = true;
networking.networkmanager = {
enable = true;
insertNameservers = [
"1.0.0.2"
"1.1.1.2"
"2606:4700:4700::1002"
"2606:4700:4700::1112"
];
};
nix.settings.experimental-features = [
"flakes"
"nix-command"

View file

@ -43,7 +43,9 @@
};
};
services = {
dnsmasq.settings = {
dnsmasq = {
enable = true;
settings = {
bind-dynamic = true;
dhcp-boot = "efi/boot/BOOTX64.EFI";
dhcp-range = [
@ -53,8 +55,10 @@
enable-ra = true;
enable-tftp = true;
interface = "br0";
port = 0;
tftp-root = "/srv/pxe/nixos/boot";
};
};
nfs.server = {
enable = true;
exports."/srv/pxe/export"."10.2.0.0/16" = [

View file

@ -16,9 +16,7 @@
./vps-init.nix
];
networking = {
networkmanager = {
dns = "dnsmasq";
ensureProfiles = {
networkmanager.ensureProfiles = {
environmentFiles = [ config.sops.secrets.wifi-env.path ];
profiles = {
dhcp-ethernet.connection = {
@ -38,24 +36,8 @@
};
};
};
};
wg-quick.interfaces.awg0.type = "amneziawg";
};
services.dnsmasq = {
enable = true;
settings = {
bogus-priv = true;
cache-size = 4096;
domain-needed = true;
no-resolv = true;
server = [
"1.0.0.2"
"1.1.1.2"
"2606:4700:4700::1002"
"2606:4700:4700::1112"
];
};
};
sops = {
age.keyFile = "/var/lib/sops-nix/key.txt";
defaultSopsFile = ../.secrets.yaml;