feat: generating firewall forwarding rules from individual machiene configs complete

This commit is contained in:
silver 2023-01-15 18:27:21 +00:00
parent c5f1bedec4
commit badcfe1ada
3 changed files with 27 additions and 9 deletions

View file

@ -1,8 +1,5 @@
{ pkgs, ... }:
{
{ pkgs, lib, nodes, ... }: {
imports = [
# applications for this particular server
../applications/firewall.nix
];
@ -14,6 +11,19 @@
};
# this server is teh firewall
skynet_firewall.enable = true;
skynet_firewall = {
enable = true;
# gonna have to get all the
forward_parsed =
# merge together with a newline char
lib.strings.concatMapStrings (x: x + "\n") (
# merge the lists together
builtins.concatLists (
# using this function "(key: value: value.config.skynet_firewall.forward)" turn the values ointo a list
lib.attrsets.mapAttrsToList (key: value: value.config.skynet_firewall.forward) nodes
)
);
};
}

View file

@ -1,8 +1,8 @@
{ pkgs, ... }:
{ pkgs, ... }: {
{
imports = [
# import it in so the options are available
../applications/firewall.nix
];
skynet_firewall.forward = [