mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-30 23:34:12 +03:00
nixos/nsswitch: add option to configure nssHosts
Enables adding or overriding the default nsswitch hosts in a generic way for packages without a nixos module.
This commit is contained in:
parent
c400bdaa49
commit
11cd761dbf
@ -61,6 +61,15 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
system.nssHosts = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
example = [ "mdns" ];
|
||||
description = ''
|
||||
List of host entries to configure in <filename>/etc/nsswitch.conf</filename>.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = {
|
||||
@ -85,7 +94,7 @@ in {
|
||||
group: ${concatStringsSep " " passwdArray}
|
||||
shadow: ${concatStringsSep " " shadowArray}
|
||||
|
||||
hosts: ${concatStringsSep " " hostArray}
|
||||
hosts: ${concatStringsSep " " config.system.nssHosts}
|
||||
networks: files
|
||||
|
||||
ethers: files
|
||||
@ -94,6 +103,8 @@ in {
|
||||
rpc: files
|
||||
'';
|
||||
|
||||
system.nssHosts = hostArray;
|
||||
|
||||
# Systemd provides 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
|
||||
|
Loading…
Reference in New Issue
Block a user