chore(deps): update flake, devshell and package Nix files

- Refresh flake.nix inputs and pins to align with current upstream
- Update devshell.nix to use revised development environment packages
- Adjust package.nix to match dependency and tooling changes from the
flake update
- Keep reproducible builds and developer tooling current

Signed-off-by: Martin Wimpress <martin@wimpress.org>
This commit is contained in:
Martin Wimpress 2026-01-23 13:10:55 +00:00
parent 1878a308e0
commit 5cd0149f3a
No known key found for this signature in database
3 changed files with 179 additions and 100 deletions

View File

@ -1,35 +1,45 @@
{ lib, {
lib,
mkShell, mkShell,
pkgs, pkgs,
stdenv, stdenv,
OVMF ? null,
OVMFFull ? null,
}: }:
mkShell { mkShell {
packages = with pkgs; ([ packages =
cdrtools with pkgs;
curl (
gawk [
gnugrep cdrtools
gnused curl
jq gawk
pciutils gnugrep
procps gnused
python3 jq
qemu_full pciutils
samba procps
socat python3
spice-gtk qemu_full
swtpm samba
unzip socat
util-linux spice-gtk
xorg.xrandr swtpm
zsync unzip
OVMF util-linux
OVMFFull xorg.xrandr
] ++ lib.optionals stdenv.isLinux [ zsync
mesa-demos ]
usbutils ++ lib.optionals stdenv.isLinux [
xdg-user-dirs mesa-demos
]); usbutils
xdg-user-dirs
]
++ lib.optionals (OVMF != null && OVMFFull != null) [
OVMF
OVMFFull
]
);
inputsFrom = with pkgs; [ inputsFrom = with pkgs; [
git git
@ -40,8 +50,12 @@ mkShell {
echo "* 'direnv reload' to update '.direnv/bin/quickemu' for testing *" echo "* 'direnv reload' to update '.direnv/bin/quickemu' for testing *"
echo "**********************************************************************" echo "**********************************************************************"
sed \ sed \
-e '/OVMF_CODE_4M.secboot.fd/s|ovmfs=(|ovmfs=("${pkgs.OVMFFull.firmware}","${pkgs.OVMFFull.variables}" |' \ ${
-e '/OVMF_CODE_4M.fd/s|ovmfs=(|ovmfs=("${pkgs.OVMF.firmware}","${pkgs.OVMF.variables}" |' \ lib.optionalString (OVMF != null && OVMFFull != null) ''
-e '/OVMF_CODE_4M.secboot.fd/s|ovmfs=(|ovmfs=("${OVMFFull.firmware}","${OVMFFull.variables}" |' \
-e '/OVMF_CODE_4M.fd/s|ovmfs=(|ovmfs=("${OVMF.firmware}","${OVMF.variables}" |' \
''
} \
-e '/cp "''${VARS_IN}" "''${VARS_OUT}"/a chmod +w "''${VARS_OUT}"' \ -e '/cp "''${VARS_IN}" "''${VARS_OUT}"/a chmod +w "''${VARS_OUT}"' \
-e 's,\$(command -v smbd),${pkgs.samba}/bin/smbd,' \ -e 's,\$(command -v smbd),${pkgs.samba}/bin/smbd,' \
quickemu > $PWD/.direnv/bin/quickemu quickemu > $PWD/.direnv/bin/quickemu

112
flake.nix
View File

@ -5,38 +5,92 @@
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz"; nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
}; };
outputs = { outputs =
self, {
flake-schemas, self,
nixpkgs, flake-schemas,
}: let nixpkgs,
}:
let
# Define supported systems and a helper function for generating system-specific outputs # Define supported systems and a helper function for generating system-specific outputs
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ]; supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
"aarch64-linux"
];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { forEachSupportedSystem =
system = system; f:
pkgs = import nixpkgs { inherit system; }; nixpkgs.lib.genAttrs supportedSystems (
}); system:
in { f {
# Define schemas for the flake's outputs system = system;
schemas = flake-schemas.schemas; pkgs = import nixpkgs { inherit system; };
}
);
in
{
# Define schemas for the flake's outputs
schemas = flake-schemas.schemas;
# Define overlays for each supported system # Define overlays for each supported system
overlays = { overlays = {
default = final: prev: { default =
quickemu = final.callPackage ./package.nix { }; final: prev:
let
# OVMF is only available/needed on Linux
ovmfArgs =
if final.stdenv.isLinux then
{ }
else
{
OVMF = null;
OVMFFull = null;
};
in
{
quickemu = final.callPackage ./package.nix ovmfArgs;
};
}; };
# Define packages for each supported system
packages = forEachSupportedSystem (
{ pkgs, system, ... }:
let
# OVMF is only available/needed on Linux
ovmfArgs =
if pkgs.stdenv.isLinux then
{ }
else
{
OVMF = null;
OVMFFull = null;
};
in
rec {
quickemu = pkgs.callPackage ./package.nix ovmfArgs;
default = quickemu;
}
);
# Define devShells for each supported system
devShells = forEachSupportedSystem (
{ pkgs, system, ... }:
let
# OVMF is only available/needed on Linux
ovmfArgs =
if pkgs.stdenv.isLinux then
{ }
else
{
OVMF = null;
OVMFFull = null;
};
in
{
default = pkgs.callPackage ./devshell.nix ovmfArgs;
}
);
}; };
# Define packages for each supported system
packages = forEachSupportedSystem ({pkgs, system, ...}: rec {
quickemu = pkgs.callPackage ./package.nix { };
default = quickemu;
});
# Define devShells for each supported system
devShells = forEachSupportedSystem ({pkgs, system, ...}: {
default = pkgs.callPackage ./devshell.nix { };
});
};
} }

View File

@ -1,33 +1,34 @@
{ lib {
, fetchFromGitHub lib,
, installShellFiles fetchFromGitHub,
, makeWrapper installShellFiles,
, stdenv makeWrapper,
, testers stdenv,
, cdrtools testers,
, curl cdrtools,
, gawk curl,
, gnugrep gawk,
, gnused gnugrep,
, jq gnused,
, mesa-demos jq,
, pciutils mesa-demos,
, procps pciutils,
, python3 procps,
, qemu_full python3,
, samba qemu_full,
, socat samba,
, spice-gtk socat,
, swtpm spice-gtk,
, unzip swtpm,
, usbutils unzip,
, util-linux usbutils,
, xdg-user-dirs util-linux,
, xrandr xdg-user-dirs,
, zsync xrandr,
, OVMF zsync,
, OVMFFull OVMF ? null,
, quickemu OVMFFull ? null,
quickemu,
}: }:
let let
runtimePaths = [ runtimePaths = [
@ -48,19 +49,19 @@ let
util-linux util-linux
xrandr xrandr
zsync zsync
]
++ lib.optionals stdenv.isLinux [
mesa-demos
OVMF OVMF
OVMFFull OVMFFull
] ++ lib.optionals stdenv.isLinux [
mesa-demos
usbutils usbutils
xdg-user-dirs xdg-user-dirs
]; ];
versionMatches = versionMatches = builtins.match ''
builtins.match '' .*
.* readonly[[:blank:]]VERSION="([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)"
readonly[[:blank:]]VERSION="([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)" .*
.* '' (builtins.readFile ./quickemu);
'' (builtins.readFile ./quickemu);
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "quickemu"; pname = "quickemu";
@ -69,14 +70,21 @@ stdenv.mkDerivation rec {
postPatch = '' postPatch = ''
sed -i \ sed -i \
-e '/OVMF_CODE_4M.secboot.fd/s|ovmfs=(|ovmfs=("${OVMFFull.firmware}","${OVMFFull.variables}" |' \ ${
-e '/OVMF_CODE_4M.fd/s|ovmfs=(|ovmfs=("${OVMF.firmware}","${OVMF.variables}" |' \ lib.optionalString (OVMF != null && OVMFFull != null) ''
-e '/OVMF_CODE_4M.secboot.fd/s|ovmfs=(|ovmfs=("${OVMFFull.firmware}","${OVMFFull.variables}" |' \
-e '/OVMF_CODE_4M.fd/s|ovmfs=(|ovmfs=("${OVMF.firmware}","${OVMF.variables}" |' \
''
} \
-e '/cp "''${VARS_IN}" "''${VARS_OUT}"/a chmod +w "''${VARS_OUT}"' \ -e '/cp "''${VARS_IN}" "''${VARS_OUT}"/a chmod +w "''${VARS_OUT}"' \
-e 's,\$(command -v smbd),${samba}/bin/smbd,' \ -e 's,\$(command -v smbd),${samba}/bin/smbd,' \
quickemu quickemu
''; '';
nativeBuildInputs = [ makeWrapper installShellFiles ]; nativeBuildInputs = [
makeWrapper
installShellFiles
];
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
@ -102,6 +110,9 @@ stdenv.mkDerivation rec {
homepage = "https://github.com/quickemu-project/quickemu"; homepage = "https://github.com/quickemu-project/quickemu";
mainProgram = "quickemu"; mainProgram = "quickemu";
license = lib.licenses.mit; license = lib.licenses.mit;
maintainers = with lib.maintainers; [ fedx-sudo flexiondotorg ]; maintainers = with lib.maintainers; [
fedx-sudo
flexiondotorg
];
}; };
} }