part 3 of the flake-parts migration
This commit is contained in:
@@ -192,12 +192,33 @@ in
|
||||
|> builtins.filter (
|
||||
name: !(lib.hasPrefix "wg-" name) && name != "vps" && name != "router" && name != hostName
|
||||
);
|
||||
shellConditional = shellType: bashContent: zshContent:
|
||||
if shellType == "bash" then
|
||||
{ initExtra = bashContent; }
|
||||
else
|
||||
{ initContent = zshContent; };
|
||||
shellConditional =
|
||||
shellType: bashContent: zshContent:
|
||||
if shellType == "bash" then { initExtra = bashContent; } else { initContent = zshContent; };
|
||||
mergeAliases = baseAliases: extraAliases: baseAliases // extraAliases;
|
||||
getServicesWithNativeFirewall =
|
||||
config: blacklist:
|
||||
config.my.servers
|
||||
|> builtins.attrNames
|
||||
|> builtins.filter (
|
||||
name:
|
||||
(config.my.servers.${name}.enable or false)
|
||||
&& !(builtins.elem name blacklist)
|
||||
&& builtins.hasAttr name config.services
|
||||
&& (config.services.${name} ? openFirewall)
|
||||
);
|
||||
generateFirewallPorts =
|
||||
config: nativeServices: lib:
|
||||
config.my.network.firewall.staticPorts
|
||||
++ config.my.network.firewall.additionalPorts
|
||||
++ (
|
||||
config.my.servers
|
||||
|> lib.filterAttrs (
|
||||
name: srv: (srv.enable or false) && (srv ? port) && !(builtins.elem name nativeServices)
|
||||
)
|
||||
|> lib.attrValues
|
||||
|> map (srv: srv.port)
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user