mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
44 lines
885 B
Nix
44 lines
885 B
Nix
{ lib, ... }:
|
|
{
|
|
name = "whois";
|
|
meta.maintainers = with lib.maintainers; [ Cryolitia ];
|
|
|
|
nodes.machine = {
|
|
imports = [ ../modules/profiles/minimal.nix ];
|
|
|
|
programs.whois = {
|
|
enable = true;
|
|
settings = [
|
|
{
|
|
pattern = "\\.dn42$";
|
|
server = "whois.dn42";
|
|
}
|
|
{
|
|
pattern = "\\-DN42$";
|
|
server = "whois.dn42";
|
|
}
|
|
{
|
|
pattern = "^as424242[0-9]{4}$";
|
|
server = "whois.dn42";
|
|
}
|
|
];
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
start_all()
|
|
|
|
machine.succeed("command -v whois")
|
|
|
|
whois_conf = machine.succeed("cat /etc/whois.conf").strip()
|
|
expected = """
|
|
# Generated by NixOS.
|
|
# See whois.conf(5) for the file format.
|
|
\\.dn42$ whois.dn42
|
|
\\-DN42$ whois.dn42
|
|
^as424242[0-9]{4}$ whois.dn42
|
|
""".strip()
|
|
assert whois_conf == expected
|
|
'';
|
|
}
|