nixos/systemd-boot: add typechecking

This commit is contained in:
Jörg Thalheim
2021-01-10 21:13:59 +01:00
parent 2cfa110ae8
commit ceda1a5eee
2 changed files with 44 additions and 18 deletions
@@ -7,7 +7,7 @@ let
efi = config.boot.loader.efi;
gummibootBuilder = pkgs.substituteAll {
systemdBootBuilder = pkgs.substituteAll {
src = ./systemd-boot-builder.py;
isExecutable = true;
@@ -30,6 +30,17 @@ let
memtest86 = if cfg.memtest86.enable then pkgs.memtest86-efi else "";
};
checkedSystemdBootBuilder = pkgs.runCommand "systemd-boot" {
nativeBuildInputs = [ pkgs.mypy ];
} ''
install -m755 ${systemdBootBuilder} $out
mypy \
--no-implicit-optional \
--disallow-untyped-calls \
--disallow-untyped-defs \
$out
'';
in {
imports =
@@ -131,7 +142,7 @@ in {
boot.loader.supportsInitrdSecrets = true;
system = {
build.installBootLoader = gummibootBuilder;
build.installBootLoader = checkedSystemdBootBuilder;
boot.loader.id = "systemd-boot";