iana-etc: fix flakify fuckups

This commit is contained in:
tv 2023-07-04 16:10:23 +02:00
parent 2bdd7ad334
commit f5cb4940f9

View File

@ -1,5 +1,6 @@
{ config, pkgs, lib, ... }: { config, lib, pkgs, ... }: let
with lib; { slib = import ../../lib/pure.nix { inherit lib; };
in with lib; {
options.krebs.iana-etc.services = mkOption { options.krebs.iana-etc.services = mkOption {
default = {}; default = {};
@ -7,7 +8,7 @@ with lib; {
options = { options = {
port = mkOption { port = mkOption {
default = config._module.args.name; default = config._module.args.name;
type = types.addCheck types.str (test "[1-9][0-9]*"); type = types.addCheck types.str (slib.test "[1-9][0-9]*");
}; };
} // genAttrs ["tcp" "udp"] (protocol: mkOption { } // genAttrs ["tcp" "udp"] (protocol: mkOption {
default = null; default = null;
@ -30,7 +31,7 @@ with lib; {
(proto: let (proto: let
line = "${entry.${proto}.name} ${entry.port}/${proto}"; line = "${entry.${proto}.name} ${entry.port}/${proto}";
in /* sh */ '' in /* sh */ ''
echo ${shell.escape line} echo ${slib.shell.escape line}
'') '')
(filter (proto: entry.${proto} != null) ["tcp" "udp"])} (filter (proto: entry.${proto} != null) ["tcp" "udp"])}
'') (attrValues config.krebs.iana-etc.services)} '') (attrValues config.krebs.iana-etc.services)}