From 39de88f344388852907ca59245d601de42be4fad Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 19 Mar 2024 06:17:12 +0000 Subject: [PATCH 1/5] mkosi: 20.2 -> 21 --- pkgs/tools/virtualization/mkosi/default.nix | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pkgs/tools/virtualization/mkosi/default.nix b/pkgs/tools/virtualization/mkosi/default.nix index 8737002c0a82..15597e6a0cd6 100644 --- a/pkgs/tools/virtualization/mkosi/default.nix +++ b/pkgs/tools/virtualization/mkosi/default.nix @@ -45,7 +45,7 @@ let in buildPythonApplication rec { pname = "mkosi"; - version = "20.2"; + version = "21"; format = "pyproject"; outputs = [ "out" "man" ]; @@ -54,22 +54,13 @@ buildPythonApplication rec { owner = "systemd"; repo = "mkosi"; rev = "v${version}"; - hash = "sha256-+mvepzoswDVIHzj+rEnlr0ouphGv5unpaNX3U8x517Y="; + hash = "sha256-ONahHWDPB9EOdqyiogLjrSwdtXidWG0aYXE4F7khg0I="; }; - patches = [ - # sandbox: Deal correctly with unmerged-usr. - # Remove on next release after v20.2. - (fetchpatch { - url = "https://github.com/systemd/mkosi/commit/5a708efdb432dee9c6e5a9a4754752359cac8944.patch"; - hash = "sha256-dXkY8Hha6y9CoZC1WdtZuI/YJsOQ1fOt4o4RsPkGWYQ="; - }) - ]; - # Fix ctypes finding library # https://github.com/NixOS/nixpkgs/issues/7307 postPatch = lib.optionalString stdenv.isLinux '' - substituteInPlace mkosi/run.py \ + substituteInPlace mkosi/user.py \ --replace 'ctypes.util.find_library("c")' "'${stdenv.cc.libc}/lib/libc.so.6'" substituteInPlace mkosi/__init__.py \ --replace '/usr/lib/systemd/ukify' "${systemdForMkosi}/lib/systemd/ukify" From 5a075604433d2213380ee1ac64a868cc0b6c4655 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 19 Mar 2024 06:25:42 +0000 Subject: [PATCH 2/5] mkosi: 21 -> 22 --- nixos/doc/manual/release-notes/rl-2405.section.md | 8 +++++--- pkgs/tools/virtualization/mkosi/default.nix | 8 +++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 0693ca9e17bc..d42434953b9d 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -293,9 +293,11 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - Proxies are now defined with a new option `settings.proxies` which takes a list of proxies. - Consult the [upstream documentation](https://github.com/fatedier/frp#example-usage) for more details on the changes. -- `mkosi` was updated to v20. Parts of the user interface have changed. Consult the - release notes of [v19](https://github.com/systemd/mkosi/releases/tag/v19) and - [v20](https://github.com/systemd/mkosi/releases/tag/v20) for a list of changes. +- `mkosi` was updated to v22. Parts of the user interface have changed. Consult the + release notes of [v19](https://github.com/systemd/mkosi/releases/tag/v19), + [v20](https://github.com/systemd/mkosi/releases/tag/v20), + [v21](https://github.com/systemd/mkosi/releases/tag/v21) and + [v22](https://github.com/systemd/mkosi/releases/tag/v22) for a list of changes. - `gonic` has been updated to v0.16.4. Config now requires `playlists-path` to be set. See the rest of the [v0.16.0 release notes](https://github.com/sentriz/gonic/releases/tag/v0.16.0) for more details. diff --git a/pkgs/tools/virtualization/mkosi/default.nix b/pkgs/tools/virtualization/mkosi/default.nix index 15597e6a0cd6..9df70d7221d3 100644 --- a/pkgs/tools/virtualization/mkosi/default.nix +++ b/pkgs/tools/virtualization/mkosi/default.nix @@ -25,7 +25,6 @@ # Optional dependencies , withQemu ? false , qemu -, OVMF }: let # For systemd features used by mkosi, see @@ -45,7 +44,7 @@ let in buildPythonApplication rec { pname = "mkosi"; - version = "21"; + version = "22"; format = "pyproject"; outputs = [ "out" "man" ]; @@ -54,7 +53,7 @@ buildPythonApplication rec { owner = "systemd"; repo = "mkosi"; rev = "v${version}"; - hash = "sha256-ONahHWDPB9EOdqyiogLjrSwdtXidWG0aYXE4F7khg0I="; + hash = "sha256-Zom1GlyhqgpTKfjcBOUEJMlubSn+TQsk97js1/UfDHY="; }; # Fix ctypes finding library @@ -66,8 +65,7 @@ buildPythonApplication rec { --replace '/usr/lib/systemd/ukify' "${systemdForMkosi}/lib/systemd/ukify" '' + lib.optionalString withQemu '' substituteInPlace mkosi/qemu.py \ - --replace '/usr/share/ovmf/x64/OVMF_VARS.fd' "${OVMF.variables}" \ - --replace '/usr/share/ovmf/x64/OVMF_CODE.fd' "${OVMF.firmware}" + --replace "usr/share/qemu/firmware" "${qemu}/share/qemu/firmware" ''; nativeBuildInputs = [ From c93b55dba5a78990c191afc2f1406dc058a0a1ed Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 19 Mar 2024 06:37:15 +0000 Subject: [PATCH 3/5] mkosi: use --replace-fail on substituteInPlace --- pkgs/tools/virtualization/mkosi/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/virtualization/mkosi/default.nix b/pkgs/tools/virtualization/mkosi/default.nix index 9df70d7221d3..b881aff31f7e 100644 --- a/pkgs/tools/virtualization/mkosi/default.nix +++ b/pkgs/tools/virtualization/mkosi/default.nix @@ -60,12 +60,12 @@ buildPythonApplication rec { # https://github.com/NixOS/nixpkgs/issues/7307 postPatch = lib.optionalString stdenv.isLinux '' substituteInPlace mkosi/user.py \ - --replace 'ctypes.util.find_library("c")' "'${stdenv.cc.libc}/lib/libc.so.6'" + --replace-fail 'ctypes.util.find_library("c")' "'${stdenv.cc.libc}/lib/libc.so.6'" substituteInPlace mkosi/__init__.py \ - --replace '/usr/lib/systemd/ukify' "${systemdForMkosi}/lib/systemd/ukify" + --replace-fail '/usr/lib/systemd/ukify' "${systemdForMkosi}/lib/systemd/ukify" '' + lib.optionalString withQemu '' substituteInPlace mkosi/qemu.py \ - --replace "usr/share/qemu/firmware" "${qemu}/share/qemu/firmware" + --replace-fail "usr/share/qemu/firmware" "${qemu}/share/qemu/firmware" ''; nativeBuildInputs = [ From d3f04e5bac4406f69d4bbb4fff1af917efd181bc Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Mon, 22 Apr 2024 19:32:49 +0200 Subject: [PATCH 4/5] mkosi-full: use systemd with kernel-install Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- pkgs/tools/virtualization/mkosi/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/virtualization/mkosi/default.nix b/pkgs/tools/virtualization/mkosi/default.nix index b881aff31f7e..72188e8fcfcf 100644 --- a/pkgs/tools/virtualization/mkosi/default.nix +++ b/pkgs/tools/virtualization/mkosi/default.nix @@ -36,6 +36,7 @@ let withFirstboot = true; withEfi = true; withUkify = true; + withKernelInstall = true; }; python3pefile = python3.withPackages (ps: with ps; [ From ddb1ac2b9090ed9c8e18cb2fe6246a761a8bc7fc Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Thu, 2 May 2024 11:53:03 +0200 Subject: [PATCH 5/5] mkosi-full: mark broken Booting VMs using `mkosi qemu` currently fails to find the image to boot. Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- pkgs/tools/virtualization/mkosi/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/virtualization/mkosi/default.nix b/pkgs/tools/virtualization/mkosi/default.nix index 72188e8fcfcf..130b47a5c9d2 100644 --- a/pkgs/tools/virtualization/mkosi/default.nix +++ b/pkgs/tools/virtualization/mkosi/default.nix @@ -120,5 +120,7 @@ buildPythonApplication rec { mainProgram = "mkosi"; maintainers = with maintainers; [ malt3 katexochen ]; platforms = platforms.linux; + # `mkosi qemu` boot fails in the uefi shell, image isn't found. + broken = withQemu; }; }