From 3c094ee5ffa1369896ad81972e7abe1bc3bda2ae Mon Sep 17 00:00:00 2001 From: nikstur Date: Sat, 26 Nov 2022 22:19:15 +0100 Subject: [PATCH] flake.nix: remove some redundancies --- flake.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index ed342c2..33b80d6 100644 --- a/flake.nix +++ b/flake.nix @@ -140,8 +140,7 @@ import json import os.path bootspec = None - def extract_bspec_attr(attr): - return bootspec.get(attr) + def convert_to_esp(store_file_path): store_dir = os.path.basename(os.path.dirname(store_file_path)) filename = os.path.basename(store_file_path) @@ -192,8 +191,8 @@ }; boot.initrd.preDeviceCommands = '' - grep "this is a very secure secret" /etc/iamasecret - ''; + grep "this is a very secure secret" /etc/iamasecret + ''; }; testScript = '' machine.start() @@ -203,18 +202,17 @@ is-initrd-secured = mkUnsignedTest { name = "unsigned-initrd-do-not-boot-under-secureboot"; path = { - src = "extract_bspec_attr('initrd')"; - dst = "convert_to_esp(extract_bspec_attr('initrd'))"; + src = "bootspec.get('initrd')"; + dst = "convert_to_esp(bootspec.get('initrd'))"; }; }; is-kernel-secured = mkUnsignedTest { name = "unsigned-kernel-do-not-boot-under-secureboot"; path = { - src = "extract_bspec_attr('kernel')"; - dst = "convert_to_esp(extract_bspec_attr('kernel'))"; + src = "bootspec.get('kernel')"; + dst = "convert_to_esp(bootspec.get('kernel'))"; }; }; - - }; + }; }; }