Skip to content

Commit 4d90d18

Browse files
committed
feat(extractors/services): add dnsmasq
1 parent d54cacc commit 4d90d18

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

icons/services/dnsmasq.svg

+1
Loading

nixos/extractors/services.nix

+20
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
filterAttrs
1212
flatten
1313
flip
14+
forEach
15+
head
1416
imap0
1517
listToAttrs
1618
mapAttrs
@@ -23,6 +25,9 @@
2325
optionalString
2426
optionalAttrs
2527
replaceStrings
28+
removePrefix
29+
splitString
30+
tail
2631
;
2732
in {
2833
options.topology.extractors.services.enable = mkEnableOption "topology service extractor" // {default = true;};
@@ -63,6 +68,21 @@ in {
6368
config.services.blocky.settings.ports);
6469
};
6570

71+
dnsmasq = mkIf config.services.dnsmasq.enable {
72+
name = "Dnsmasq";
73+
icon = "services.dnsmasq";
74+
details = let
75+
addresses = config.services.dnsmasq.settings.address;
76+
in
77+
listToAttrs (forEach
78+
(forEach addresses
79+
(x: (splitString "/" (removePrefix "/" x))))
80+
(x: {
81+
name = head x;
82+
value.text = head (tail x);
83+
}));
84+
};
85+
6686
esphome = mkIf config.services.esphome.enable {
6787
name = "ESPHome";
6888
icon = "services.esphome";

0 commit comments

Comments
 (0)