summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Pykhalov <go.wigust@gmail.com>2020-11-18 15:12:06 +0300
committerOleg Pykhalov <go.wigust@gmail.com>2020-11-18 15:12:06 +0300
commit50dc7d66d2a11c55caceaa8da92bcfec0c1bd856 (patch)
tree66d853988fbc1bed05064c1acf6ef68df16c94ba
parentMerge pull request #88501 from jokogr/u/fritzconnection-1.2.1-20.03 (diff)
downloadnixpkgs-nixos-20.03.tar.gz
nixos: modules: system: boot: systemd: Add check phase.nixos-20.03
-rw-r--r--nixos/modules/system/boot/systemd.nix13
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 = {