Remove per‑host printers.nix and merge printing settings into host variables. Add simple-scan package and enable it for desktop and laptop hosts. Disable simple-scan for the default host. Enable SANE daemon and expose its libraries in fish init. Open required UDP ports 5353 and 54925 in network module.
51 lines
1.0 KiB
Nix
51 lines
1.0 KiB
Nix
{
|
|
host,
|
|
hostId,
|
|
options,
|
|
...
|
|
}: {
|
|
# Defensive assertion for hostname validity (clearer message at eval time)
|
|
assertions = [
|
|
{
|
|
assertion = builtins.match "^[[:alnum:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$" host != null;
|
|
message = "Invalid hostname '${host}'. Must be 1-63 chars, start/end alphanumeric; allowed middle chars: letters, digits, '-' or '_'.";
|
|
}
|
|
];
|
|
|
|
networking = {
|
|
hostName = "${host}";
|
|
hostId = hostId;
|
|
networkmanager.enable = true;
|
|
timeServers = options.networking.timeServers.default ++ ["pool.ntp.org"];
|
|
firewall = {
|
|
enable = true;
|
|
allowedTCPPorts = [
|
|
22
|
|
80
|
|
443
|
|
59010
|
|
59011
|
|
8080
|
|
];
|
|
allowedTCPPortRanges = [
|
|
{
|
|
from = 1714;
|
|
to = 1764;
|
|
}
|
|
];
|
|
allowedUDPPorts = [
|
|
5353
|
|
54925
|
|
59010
|
|
59011
|
|
];
|
|
allowedUDPPortRanges = [
|
|
{
|
|
from = 1714;
|
|
to = 1764;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|