nixos/top-level: Check syntax of switch-to-configuration

This commit is contained in:
Janne Heß 2021-12-05 18:54:36 +01:00
parent 6f1e0dc34f
commit b30d619368
No known key found for this signature in database
GPG Key ID: 69165158F05265DF

View File

@ -78,6 +78,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