Skip to content

Commit

Permalink
xen: move to by-name
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Rodrigues <[email protected]>
  • Loading branch information
SigmaSquadron committed Sep 29, 2024
1 parent ce14b35 commit 3bb65e6
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 113 deletions.
56 changes: 0 additions & 56 deletions pkgs/applications/virtualization/xen/packages.nix

This file was deleted.

2 changes: 1 addition & 1 deletion pkgs/build-support/xen/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ stdenv.mkDerivation (finalAttrs: {
]
++ lib.lists.optional (!withInternalQEMU) "--with-system-qemu"

++ lib.lists.optional withSeaBIOS "--with-system-seabios=${seabios}/share/seabios"
++ lib.lists.optional withSeaBIOS "--with-system-seabios=${seabios.firmware}"
++ lib.lists.optional (!withInternalSeaBIOS && !withSeaBIOS) "--disable-seabios"

++ lib.lists.optional withOVMF "--with-system-ovmf=${OVMF.firmware}"
Expand Down
1 change: 1 addition & 0 deletions pkgs/by-name/xe/xen-slim/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ xen_4_19-slim }: xen_4_19-slim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Some other notable packages that compose the Xen Project Ecosystem include:

### Manually

1. Create one directory per branch.
1. Create one directory per Xen version in pkgs/by-name/xe.
1. [Update](https://xenbits.xenproject.org/gitweb/) the `default.nix` files for
the branches that already exist and copy a new one to any branches that do
not yet exist in Nixpkgs.
Expand Down Expand Up @@ -71,7 +71,7 @@ are requested by the main Xen build.
Building `xen.efi` requires an `ld` with PE support.[^2]

We use a `makeFlag` to override the `$LD` environment variable to point to our
patched `efiBinutils`. For more information, see the comment in `./generic/default.nix`.
patched `efiBinutils`. For more information, see the comment in `pkgs/build-support/xen/default.nix`.

> [!TIP]
> If you are certain you will not be running Xen in an x86 EFI environment, disable
Expand Down
1 change: 1 addition & 0 deletions pkgs/by-name/xe/xen/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ xen_4_19 }: xen_4_19
1 change: 1 addition & 0 deletions pkgs/by-name/xe/xen_4_18-slim/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ xen_4_18 }: xen_4_18.override { slim = true; }
Original file line number Diff line number Diff line change
@@ -1,36 +1,22 @@
{
lib,
fetchpatch,
callPackage,
ocaml-ng,
...
}@genericDefinition:
buildXenPackage,
slim ? false,
}:

let
upstreamPatches = import ../generic/patches.nix {
inherit lib;
inherit fetchpatch;
};

upstreamPatchList = lib.lists.flatten (
with upstreamPatches;
[
QUBES_REPRODUCIBLE_BUILDS
XSA_462
]
);
in

callPackage (import ../generic/default.nix {
buildXenPackage.override { inherit slim; } {
pname = "xen";
branch = "4.18";
version = "4.18.3";
genericPatchList = [
"QUBES_REPRODUCIBLE_BUILDS"
"XSA_462"
];
latest = false;
pkg = {
xen = {
rev = "bd51e573a730efc569646379cd59ccba967cde97";
hash = "sha256-OFiFdpPCXR+sWjzFHCORtY4DkWyggvxkcsGdgEyO1ts=";
patches = [ ] ++ upstreamPatchList;
patches = [ ];
};
qemu = {
rev = "0df9387c8983e1b1e72d8c574356f572342c03e6";
Expand All @@ -53,4 +39,4 @@ callPackage (import ../generic/default.nix {
patches = [ ];
};
};
}) ({ ocamlPackages = ocaml-ng.ocamlPackages_4_14; } // genericDefinition)
}
1 change: 1 addition & 0 deletions pkgs/by-name/xe/xen_4_19-slim/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ xen_4_19 }: xen_4_19.override { slim = true; }
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
{
lib,
fetchpatch,
callPackage,
ocaml-ng,
...
}@genericDefinition:
buildXenPackage,
slim ? false,
}:

let
upstreamPatches = import ../generic/patches.nix {
inherit lib;
inherit fetchpatch;
};

upstreamPatchList = lib.lists.flatten (
with upstreamPatches;
[
QUBES_REPRODUCIBLE_BUILDS
XSA_460
XSA_461
XSA_462
]
);
in

callPackage (import ../generic/default.nix {
buildXenPackage.override { inherit slim; } {
pname = "xen";
branch = "4.19";
version = "4.19.0";
genericPatchList = [
"QUBES_REPRODUCIBLE_BUILDS"
"XSA_460"
"XSA_461"
"XSA_462"
];
latest = true;
pkg = {
xen = {
rev = "026c9fa29716b0ff0f8b7c687908e71ba29cf239";
hash = "sha256-Q6x+2fZ4ITBz6sKICI0NHGx773Rc919cl+wzI89UY+Q=";
patches = [ ] ++ upstreamPatchList;
patches = [ ];
};
qemu = {
rev = "0df9387c8983e1b1e72d8c574356f572342c03e6";
Expand All @@ -55,4 +41,14 @@ callPackage (import ../generic/default.nix {
patches = [ ];
};
};
}) ({ ocamlPackages = ocaml-ng.ocamlPackages_4_14; } // genericDefinition)
descriptions = {
description = "Standard";
longDescription = ''
Standard version of the Xen Project Hypervisor. Uses forks of QEMU, SeaBIOS,
OVMF and iPXE provided by the Xen Project. This provides the vanilla Xen
experience, but wastes space and build time. A typical NixOS setup that runs
lots of VMs will usually need to build two different versions of QEMU when using
this Xen derivation (one fork and upstream).
'';
};
}
4 changes: 0 additions & 4 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34020,10 +34020,6 @@ with pkgs;

xdotool = callPackage ../tools/X11/xdotool { };

xenPackages = recurseIntoAttrs (callPackage ../applications/virtualization/xen/packages.nix {});

xen = xenPackages.xen_4_19;
xen-slim = xenPackages.xen_4_19-slim;
buildXenPackage = callPackage ../build-support/xen { };

xkbset = callPackage ../tools/X11/xkbset { };
Expand Down

0 comments on commit 3bb65e6

Please sign in to comment.