mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
Use nss-myhostname to ensure that the hostname resolves to something sensible
This commit is contained in:
parent
757ab7f6d3
commit
13841d6e47
1 changed files with 6 additions and 1 deletions
|
@ -48,7 +48,7 @@ in
|
||||||
passwd: files ldap
|
passwd: files ldap
|
||||||
group: files ldap
|
group: files ldap
|
||||||
shadow: files ldap
|
shadow: files ldap
|
||||||
hosts: files ${optionalString nssmdns "mdns_minimal [NOTFOUND=return]"} dns ${optionalString nssmdns "mdns"}
|
hosts: files ${optionalString nssmdns "mdns_minimal [NOTFOUND=return]"} dns ${optionalString nssmdns "mdns"} myhostname
|
||||||
networks: files dns
|
networks: files dns
|
||||||
ethers: files
|
ethers: files
|
||||||
services: files
|
services: files
|
||||||
|
@ -58,6 +58,11 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Use nss-myhostname to ensure that our hostname always resolves to
|
||||||
|
# a valid IP address. It returns all locally configured IP
|
||||||
|
# addresses, or ::1 and 127.0.0.2 as fallbacks.
|
||||||
|
system.nssModules = [ pkgs.nss_myhostname ];
|
||||||
|
|
||||||
environment.shellInit =
|
environment.shellInit =
|
||||||
if config.system.nssModules.path != "" then
|
if config.system.nssModules.path != "" then
|
||||||
''
|
''
|
||||||
|
|
Loading…
Reference in a new issue