diff --git a/nixos/modules/services/networking/networkd-dispatcher.nix b/nixos/modules/services/networking/networkd-dispatcher.nix index 49d5cd545656a..5e307d81624ee 100644 --- a/nixos/modules/services/networking/networkd-dispatcher.nix +++ b/nixos/modules/services/networking/networkd-dispatcher.nix @@ -102,21 +102,23 @@ in services.networkd-dispatcher.extraArgs = let - scriptDir = pkgs.symlinkJoin { - name = "networkd-dispatcher-script-dir"; - paths = lib.mapAttrsToList ( - name: cfg: - (map ( - state: - pkgs.writeTextFile { - inherit name; - text = cfg.script; - destination = "/${state}.d/${name}"; - executable = true; - } - ) cfg.onState) - ) cfg.rules; - }; + scriptDir = pkgs.runCommand "networkd-dispatcher-script-dir" { } '' + mkdir $out + ${lib.concatStrings ( + lib.mapAttrsToList ( + name: cfg: + (lib.concatStrings ( + map (state: '' + mkdir -p $out/${state}.d + ln -s ${ + pkgs.writeShellApplication { + inherit name; + text = cfg.script; + } + }/bin/${name} $out/${state}.d/${name}'') cfg.onState + )) + ) cfg.rules + )}''; in [ "--verbose"