summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-1.nix
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2018-06-10 20:18:55 +0000
committerJan Malakhovski <oxij@oxij.org>2018-08-08 02:43:17 +0000
commitdc653449c541312a120b2dd25fad118e04828b62 (patch)
tree593e413c070c43fef437776b3d6b893ad8e2532b /nixos/modules/system/boot/stage-1.nix
parentb55c02e878b7b0677cd3f7ca3d041c07f8b58051 (diff)
downloadnixlib-dc653449c541312a120b2dd25fad118e04828b62.tar
nixlib-dc653449c541312a120b2dd25fad118e04828b62.tar.gz
nixlib-dc653449c541312a120b2dd25fad118e04828b62.tar.bz2
nixlib-dc653449c541312a120b2dd25fad118e04828b62.tar.lz
nixlib-dc653449c541312a120b2dd25fad118e04828b62.tar.xz
nixlib-dc653449c541312a120b2dd25fad118e04828b62.tar.zst
nixlib-dc653449c541312a120b2dd25fad118e04828b62.zip
nixos: boot/stage-1: check syntax of the generated script
Diffstat (limited to 'nixos/modules/system/boot/stage-1.nix')
-rw-r--r--nixos/modules/system/boot/stage-1.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix
index 71b806a0b4e1..2caab69cbb95 100644
--- a/nixos/modules/system/boot/stage-1.nix
+++ b/nixos/modules/system/boot/stage-1.nix
@@ -248,6 +248,14 @@ let
 
     isExecutable = true;
 
+    postInstall = ''
+      echo checking syntax
+      # check both with bash
+      ${pkgs.bash}/bin/sh -n $target
+      # and with ash shell, just in case
+      ${extraUtils}/bin/ash -n $target
+    '';
+
     inherit udevRules extraUtils modulesClosure;
 
     inherit (config.boot) resumeDevice;