treewide: format with nixpkgs-fmt

This commit is contained in:
nikstur 2022-12-25 15:43:52 +01:00
parent 07fc31613e
commit eb9b1bbbe3
2 changed files with 86 additions and 79 deletions

View File

@ -40,9 +40,12 @@
}; };
# Build attributes for a Rust application. # Build attributes for a Rust application.
buildRustApp = { buildRustApp =
src, target ? null, doCheck ? true { src
}: let , target ? null
, doCheck ? true
}:
let
cleanedSrc = craneLib.cleanCargoSource src; cleanedSrc = craneLib.cleanCargoSource src;
commonArgs = { commonArgs = {
src = cleanedSrc; src = cleanedSrc;
@ -51,7 +54,8 @@
}; };
cargoArtifacts = craneLib.buildDepsOnly commonArgs; cargoArtifacts = craneLib.buildDepsOnly commonArgs;
in { in
{
package = craneLib.buildPackage (commonArgs // { package = craneLib.buildPackage (commonArgs // {
inherit cargoArtifacts; inherit cargoArtifacts;
}); });
@ -76,7 +80,8 @@
lanzatool-unwrapped = lanzatoolCrane.package; lanzatool-unwrapped = lanzatoolCrane.package;
lanzatool = pkgs.runCommand "lanzatool" { lanzatool = pkgs.runCommand "lanzatool"
{
nativeBuildInputs = [ pkgs.makeWrapper ]; nativeBuildInputs = [ pkgs.makeWrapper ];
} '' } ''
mkdir -p $out/bin mkdir -p $out/bin
@ -88,7 +93,8 @@
--set RUST_BACKTRACE full \ --set RUST_BACKTRACE full \
--set LANZABOOTE_STUB ${lanzaboote}/bin/lanzaboote.efi --set LANZABOOTE_STUB ${lanzaboote}/bin/lanzaboote.efi
''; '';
in { in
{
overlays.default = final: prev: { overlays.default = final: prev: {
inherit lanzatool; inherit lanzatool;
}; };
@ -122,8 +128,9 @@
]; ];
}; };
checks.x86_64-linux = let checks.x86_64-linux =
mkSecureBootTest = { name, machine ? {}, testScript }: nixpkgs-test.legacyPackages.x86_64-linux.nixosTest { let
mkSecureBootTest = { name, machine ? { }, testScript }: nixpkgs-test.legacyPackages.x86_64-linux.nixosTest {
inherit name testScript; inherit name testScript;
nodes.machine = { lib, ... }: { nodes.machine = { lib, ... }: {
imports = [ imports = [