From 7f3c409d56f296628e91fde9386f5ce1d2c03dd6 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 12 Apr 2021 13:38:56 -0700 Subject: [PATCH] Force hosts to contain proper localhost --- config/profile-config/common.nix | 2 +- lib/fudo/hosts.nix | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/config/profile-config/common.nix b/config/profile-config/common.nix index f27b7c4..e95e398 100644 --- a/config/profile-config/common.nix +++ b/config/profile-config/common.nix @@ -31,7 +31,7 @@ in { }; libdefaults = { - allow_weak_crypto = false; + allow_weak_crypto = true; dns_lookup_kdc = true; dns_lookup_realm = true; forwardable = true; diff --git a/lib/fudo/hosts.nix b/lib/fudo/hosts.nix index b0993c8..6c12067 100644 --- a/lib/fudo/hosts.nix +++ b/lib/fudo/hosts.nix @@ -143,7 +143,22 @@ in { # Necessary to ensure that Kerberos and Avahi both work. Kerberos needs # the fqdn of the host, whereas Avahi wants just the simple hostname.` - hosts = { "127.0.0.1" = [ "${hostname}.${domain-name}" "${hostname}" ]; }; + hosts = { + "127.0.0.2" = [ "${hostname}.${domain-name}" "${hostname}" ]; + "127.0.0.1" = [ "${hostname}.${domain-name}" "${hostname}" ]; + "::1" = [ "${hostname}.${domain-name}" "${hostname}" ]; + }; + }; + + environment.etc.hosts = mkForce { + text = '' + 127.0.0.1 ${hostname}.${domain-name} ${hostname} localhost + 127.0.0.2 ${hostname} localhost + ::1 ${hostname}.${domain-name} ${hostname} localhost + ''; + user = "root"; + group = "root"; + mode = "0444"; }; nix = mkIf