diff options
author | Janne Heß <janne@hess.ooo> | 2021-10-10 13:02:09 +0200 |
---|---|---|
committer | Janne Heß <janne@hess.ooo> | 2021-10-17 14:33:42 +0200 |
commit | c4d34cd1844d3784c69c5fdb06cad716330707e7 (patch) | |
tree | 1e0f03fb17e11fd445e358b1210f5142b44e69bd /nixos/modules/system/activation/top-level.nix | |
parent | f0a31f9b9f7a96c22907e9b508cda891861ecee7 (diff) | |
download | nixpkgs-c4d34cd1844d3784c69c5fdb06cad716330707e7.tar nixpkgs-c4d34cd1844d3784c69c5fdb06cad716330707e7.tar.gz nixpkgs-c4d34cd1844d3784c69c5fdb06cad716330707e7.tar.bz2 nixpkgs-c4d34cd1844d3784c69c5fdb06cad716330707e7.tar.lz nixpkgs-c4d34cd1844d3784c69c5fdb06cad716330707e7.tar.xz nixpkgs-c4d34cd1844d3784c69c5fdb06cad716330707e7.tar.zst nixpkgs-c4d34cd1844d3784c69c5fdb06cad716330707e7.zip |
nixos/top-level: Check Syntax of switch-to-configuration
Diffstat (limited to 'nixos/modules/system/activation/top-level.nix')
-rw-r--r-- | nixos/modules/system/activation/top-level.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix index 026fd1791d3..68da910d29c 100644 --- a/nixos/modules/system/activation/top-level.nix +++ b/nixos/modules/system/activation/top-level.nix @@ -84,6 +84,13 @@ let export localeArchive="${config.i18n.glibcLocales}/lib/locale/locale-archive" substituteAll ${./switch-to-configuration.pl} $out/bin/switch-to-configuration chmod +x $out/bin/switch-to-configuration + ${optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) '' + if ! output=$($perl/bin/perl -c $out/bin/switch-to-configuration 2>&1); then + echo "switch-to-configuration syntax is not valid:" + echo "$output" + exit 1 + fi + ''} echo -n "${toString config.system.extraDependencies}" > $out/extra-dependencies |