From 60590e12304ced7a280241728a1ad2841f68f911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Fri, 11 Feb 2022 22:21:04 +0100 Subject: [PATCH] :rocket: static ip with static dns --- hosts/nixos-desktop/default.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index da5af63..fac947f 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -32,15 +32,25 @@ defaultGateway = "192.168.0.1"; nameservers = [ "192.168.0.4" ]; useDHCP = false; - interfaces.enp42s0.useDHCP = true; + interfaces.enp42s0 = { + ipv4.addresses = [{ + address = "192.168.0.14"; + prefixLength = 24; + }]; + ipv6.addresses = [{ + address = "fe80::60fb:ffc:df6f:e29e"; + prefixLength = 64; + }]; + }; networkmanager = { enable = true; - dns = lib.mkIf (config.services.resolved.enable) "systemd-resolved"; + dns = "none"; }; + dhcpcd.extraConfig = '' + nohook resolv.conf + ''; }; - services.resolved.enable = lib.mkDefault false; - services.xserver.videoDrivers = [ "nvidia" ]; services.xserver.xrandrHeads = [ { output = "HDMI-1"; }