Merge pull request #268887 from jchw-forks/libvirt-nss

This commit is contained in:
Franz Pletz
2023-11-30 20:48:24 +01:00
committed by GitHub
2 changed files with 40 additions and 1 deletions

View File

@@ -172,6 +172,31 @@ let
};
};
};
nssModule = types.submodule {
options = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
This option enables the older libvirt NSS module. This method uses
DHCP server records, therefore is dependent on the hostname provided
by the guest.
Please see https://libvirt.org/nss.html for more information.
'';
};
enableGuest = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
This option enables the newer libvirt_guest NSS module. This module
uses the libvirt guest name instead of the hostname of the guest.
Please see https://libvirt.org/nss.html for more information.
'';
};
};
};
in
{
@@ -290,6 +315,14 @@ in
Hooks related options.
'';
};
nss = mkOption {
type = nssModule;
default = { };
description = lib.mdDoc ''
libvirt NSS module options.
'';
};
};
@@ -480,5 +513,11 @@ in
});
'';
};
system.nssModules = optional (cfg.nss.enable or cfg.nss.enableGuest) cfg.package;
system.nssDatabases.hosts = builtins.concatLists [
(optional cfg.nss.enable "libvirt")
(optional cfg.nss.enableGuest "libvirt_guest")
];
};
}