feat(configuration): Make /etc/resolv.conf immutable
This commit is contained in:
parent
1c8d158718
commit
7c01f06554
1 changed files with 10 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
|
@ -39,6 +39,15 @@
|
||||||
firewall.allowedTCPPorts = [ 5556 5558 ];
|
firewall.allowedTCPPorts = [ 5556 5558 ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Generate an immutable /etc/resolv.conf from the nameserver settings
|
||||||
|
# above (otherwise DHCP overwrites it):
|
||||||
|
environment.etc."resolv.conf" = with lib; with pkgs; {
|
||||||
|
source = writeText "resolv.conf" ''
|
||||||
|
${concatStringsSep "\n" (map (ns: "nameserver ${ns}") config.networking.nameservers)}
|
||||||
|
options edns0
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# Configure emacs:
|
# Configure emacs:
|
||||||
# (actually, that's a lie, this only installs emacs!)
|
# (actually, that's a lie, this only installs emacs!)
|
||||||
services.emacs = {
|
services.emacs = {
|
||||||
|
|
Loading…
Reference in a new issue