rewrite networking modules
This commit is contained in:
parent
49298541e5
commit
0bbb0aa204
11 changed files with 69 additions and 71 deletions
27
modules/net/dispatchers/default.nix
Normal file
27
modules/net/dispatchers/default.nix
Normal 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))
|
||||
)
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue