rewrite networking modules

This commit is contained in:
Schrottkatze 2025-03-27 20:18:54 +01:00
parent 49298541e5
commit 0bbb0aa204
Signed by: schrottkatze
SSH key fingerprint: SHA256:FPOYVeBy3QP20FEM42uWF1Wa/Qhlk+L3S2+Wuau/Auo
11 changed files with 69 additions and 71 deletions

View file

@ -0,0 +1,27 @@
{pkgs, ...}: let
addNuShebang = path:
builtins.concatStringsSep "\n\n" [
"#!${pkgs.nushell}/bin/nu"
(builtins.readFile path)
];
in {
networking.networkmanager.dispatcherScripts = [
{
type = "basic";
source = pkgs.writeText "dispatcher" (addNuShebang ./dispatcher.nu);
}
];
environment.etc = with builtins; (
listToAttrs (
map (v: {
name = "networkhooks/${v}";
value = {
text = addNuShebang ./hooks/${v};
mode = "0755";
};
})
(attrNames (readDir ./hooks))
)
);
}