dns through nm

This commit is contained in:
bogale 2026-11-02 00:02:57 +09:00
commit b609d1e774
3 changed files with 40 additions and 45 deletions

View file

@ -34,7 +34,15 @@
]; ];
i18n.defaultLocale = "ru_RU.UTF-8"; i18n.defaultLocale = "ru_RU.UTF-8";
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; 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 = [ nix.settings.experimental-features = [
"flakes" "flakes"
"nix-command" "nix-command"

View file

@ -43,17 +43,22 @@
}; };
}; };
services = { services = {
dnsmasq.settings = { dnsmasq = {
bind-dynamic = true; enable = true;
dhcp-boot = "efi/boot/BOOTX64.EFI"; settings = {
dhcp-range = [ bind-dynamic = true;
"10.2.0.2,10.2.255.254,12h" bogus-priv = true;
"fc02::2,fc02::ffff:ffff:ffff:ffff,12h" dhcp-boot = "efi/boot/BOOTX64.EFI";
]; dhcp-range = [
enable-ra = true; "10.2.0.2,10.2.255.254,12h"
enable-tftp = true; "fc02::2,fc02::ffff:ffff:ffff:ffff,12h"
interface = "br0"; ];
tftp-root = "/srv/pxe/nixos/boot"; domain-needed = true;
enable-ra = true;
enable-tftp = true;
interface = "br0";
tftp-root = "/srv/pxe/nixos/boot";
};
}; };
nfs.server = { nfs.server = {
enable = true; enable = true;

View file

@ -16,46 +16,28 @@
./vps-init.nix ./vps-init.nix
]; ];
networking = { networking = {
networkmanager = { networkmanager.ensureProfiles = {
dns = "dnsmasq"; environmentFiles = [ config.sops.secrets.wifi-env.path ];
ensureProfiles = { profiles = {
environmentFiles = [ config.sops.secrets.wifi-env.path ]; dhcp-ethernet.connection = {
profiles = { id = "dhcp-ethernet";
dhcp-ethernet.connection = { type = "ethernet";
id = "dhcp-ethernet"; };
type = "ethernet"; home-wifi = {
connection = {
id = "home-wifi";
type = "wifi";
}; };
home-wifi = { wifi-security = {
connection = { key-mgmt = "sae";
id = "home-wifi"; psk = "$BOGALE_PSK";
type = "wifi";
};
wifi-security = {
key-mgmt = "sae";
psk = "$BOGALE_PSK";
};
wifi.ssid = "bogale";
}; };
wifi.ssid = "bogale";
}; };
}; };
}; };
wg-quick.interfaces.awg0.type = "amneziawg"; 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 = { sops = {
age.keyFile = "/var/lib/sops-nix/key.txt"; age.keyFile = "/var/lib/sops-nix/key.txt";
defaultSopsFile = ../.secrets.yaml; defaultSopsFile = ../.secrets.yaml;