diff options
| -rw-r--r-- | nixos/modules/system/boot/systemd.nix | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index b63672df1e86..d7b7057a9def 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -201,8 +201,17 @@ let ]; makeJobScript = name: text: - let mkScriptName = s: "unit-script-" + (replaceChars [ "\\" "@" ] [ "-" "_" ] (shellEscape s) ); - in pkgs.writeTextFile { name = mkScriptName name; executable = true; inherit text; }; + let + mkScriptName = s: "unit-script-" + (replaceChars [ "\\" "@" ] [ "-" "_" ] (shellEscape s) ); + in pkgs.writeTextFile { + name = mkScriptName name; + executable = true; + inherit text; + checkPhase = '' + ${pkgs.stdenv.shell} -n "$out/bin/${scriptName}" + ${pkgs.shellcheck} "$out/bin/${scriptName}" + ''; + }; unitConfig = { config, options, ... }: { config = { |
