From 12f6399c1e6dc2159b5df63d80183908190e7629 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Mon, 2 Sep 2024 11:48:15 +0200 Subject: [PATCH] mkosi: format --- pkgs/tools/virtualization/mkosi/default.nix | 127 +++++++++++--------- 1 file changed, 69 insertions(+), 58 deletions(-) diff --git a/pkgs/tools/virtualization/mkosi/default.nix b/pkgs/tools/virtualization/mkosi/default.nix index be3367930093..cd1a368edbe0 100644 --- a/pkgs/tools/virtualization/mkosi/default.nix +++ b/pkgs/tools/virtualization/mkosi/default.nix @@ -1,30 +1,31 @@ -{ lib -, fetchFromGitHub -, stdenv -, python3 -, systemd -, pandoc -, kmod -, gnutar -, util-linux -, cpio -, bash -, coreutils -, btrfs-progs -, libseccomp -, replaceVars +{ + lib, + fetchFromGitHub, + stdenv, + python3, + systemd, + pandoc, + kmod, + gnutar, + util-linux, + cpio, + bash, + coreutils, + btrfs-progs, + libseccomp, + replaceVars, # Python packages -, setuptools -, setuptools-scm -, wheel -, buildPythonApplication -, pytestCheckHook -, pefile + setuptools, + setuptools-scm, + wheel, + buildPythonApplication, + pytestCheckHook, + pefile, # Optional dependencies -, withQemu ? false -, qemu + withQemu ? false, + qemu, }: let # For systemd features used by mkosi, see @@ -39,16 +40,21 @@ let withKernelInstall = true; }; - python3pefile = python3.withPackages (ps: with ps; [ - pefile - ]); + python3pefile = python3.withPackages ( + ps: with ps; [ + pefile + ] + ); in buildPythonApplication rec { pname = "mkosi"; version = "24.3-unstable-2024-08-28"; format = "pyproject"; - outputs = [ "out" "man" ]; + outputs = [ + "out" + "man" + ]; src = fetchFromGitHub { owner = "systemd"; @@ -57,26 +63,29 @@ buildPythonApplication rec { hash = "sha256-rO/4ki2nAJQN2slmYuHKESGBBDMXC/ikGf6dMDcKFr4="; }; - patches = [ - (replaceVars ./0001-Use-wrapped-binaries-instead-of-Python-interpreter.patch { - UKIFY = "${systemdForMkosi}/lib/systemd/ukify"; - PYTHON_PEFILE = "${python3pefile}/bin/python3.12"; - MKOSI_SANDBOX = "~MKOSI_SANDBOX~"; # to satisfy replaceVars, will be replaced in postPatch - }) - (replaceVars ./0002-Fix-library-resolving.patch { - LIBC = "${stdenv.cc.libc}/lib/libc.so.6"; - LIBSECCOMP = "${libseccomp.lib}/lib/libseccomp.so.2"; - }) - ] ++ lib.optional withQemu (replaceVars ./0003-Fix-QEMU-firmware-path.patch { - QEMU_FIRMWARE = "${qemu}/share/qemu/firmware"; - }); + patches = + [ + (replaceVars ./0001-Use-wrapped-binaries-instead-of-Python-interpreter.patch { + UKIFY = "${systemdForMkosi}/lib/systemd/ukify"; + PYTHON_PEFILE = "${python3pefile}/bin/python3.12"; + MKOSI_SANDBOX = "~MKOSI_SANDBOX~"; # to satisfy replaceVars, will be replaced in postPatch + }) + (replaceVars ./0002-Fix-library-resolving.patch { + LIBC = "${stdenv.cc.libc}/lib/libc.so.6"; + LIBSECCOMP = "${libseccomp.lib}/lib/libseccomp.so.2"; + }) + ] + ++ lib.optional withQemu ( + replaceVars ./0003-Fix-QEMU-firmware-path.patch { + QEMU_FIRMWARE = "${qemu}/share/qemu/firmware"; + } + ); - postPatch = - '' - # As we need the $out reference, we can't use `replaceVars` here. - substituteInPlace mkosi/run.py \ - --replace-fail '~MKOSI_SANDBOX~' "\"$out/bin/mkosi-sandbox\"" - ''; + postPatch = '' + # As we need the $out reference, we can't use `replaceVars` here. + substituteInPlace mkosi/run.py \ + --replace-fail '~MKOSI_SANDBOX~' "\"$out/bin/mkosi-sandbox\"" + ''; nativeBuildInputs = [ pandoc @@ -85,18 +94,20 @@ buildPythonApplication rec { wheel ]; - propagatedBuildInputs = [ - bash - btrfs-progs - coreutils - cpio - gnutar - kmod - systemdForMkosi - util-linux - ] ++ lib.optional withQemu [ - qemu - ]; + propagatedBuildInputs = + [ + bash + btrfs-progs + coreutils + cpio + gnutar + kmod + systemdForMkosi + util-linux + ] + ++ lib.optional withQemu [ + qemu + ]; postBuild = '' ./tools/make-man-page.sh