Unverified Commit 55c3343f authored by Ryan Lahfa's avatar Ryan Lahfa Committed by GitHub
Browse files

bootspec: generalize the bootspec tooling packaging (#401484)

parents 55ba1baf e9c6d760
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -111,6 +111,8 @@ in
            Enable this option if you want to ascertain that your documents are correct
    '';

    package = lib.mkPackageOption pkgs "bootspec" { };

    extensions = lib.mkOption {
      # NOTE(RaitoBezarius): this is not enough to validate: extensions."osRelease" = drv; those are picked up by cue validation.
      type = lib.types.attrsOf lib.types.anything; # <namespace>: { ...namespace-specific fields }
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ let

      systemd = config.systemd.package;

      bootspecTools = pkgs.bootspec;
      bootspecTools = config.boot.bootspec.package;

      nix = config.nix.package.out;

+88 −86
Original line number Diff line number Diff line
@@ -680,7 +680,9 @@ let
        in
        {
          # The configuration of the system used to run "nixos-install".
          installer = {
          installer =
            { config, ... }:
            {
              imports = [
                commonConfig
                ../modules/profiles/installation-device.nix
@@ -701,8 +703,8 @@ let
              virtualisation.emptyDiskImages = [ 512 ];
              virtualisation.rootDevice = "/dev/vdb";

            hardware.enableAllFirmware = mkForce false;
              nix.package = selectNixPackage pkgs;
              hardware.enableAllFirmware = mkForce false;

              # The test cannot access the network, so any packages we
              # need must be included in the VM.
@@ -758,7 +760,7 @@ let
                ++ optionals (bootLoader == "systemd-boot") [
                  pkgs.zstd.bin
                  pkgs.mypy
                pkgs.bootspec
                  config.boot.bootspec.package
                ]
                ++ optionals clevisTest [ pkgs.klibc ]
                ++ optional systemdStage1 pkgs.chroot-realpath;
+39 −0
Original line number Diff line number Diff line
{
  lib,
  rustPlatform,
  fetchFromGitea,
  fetchpatch,
}:
rustPlatform.buildRustPackage rec {
  pname = "bootspec-lix";
  version = "1.0.0";

  src = fetchFromGitea {
    domain = "git.lix.systems";
    owner = "lix-community";
    repo = "bootspec";
    rev = "v${version}";
    hash = "sha256-5IGSMHeL0eKfl7teDejAckYQjc8aeLwfwIQSzQ8YaAg=";
  };

  patches = [
    # https://github.com/DeterminateSystems/bootspec/pull/127
    # Fixes the synthesize tool for aarch64-linux
    (fetchpatch {
      name = "aarch64-support.patch";
      url = "https://github.com/DeterminateSystems/bootspec/commit/1d0e925f360f0199f13422fb7541225fd162fd4f.patch";
      sha256 = "sha256-wU/jWnOqVBrU2swANdXbQfzRpNd/JIS4cxSyCvixZM0=";
    })
  ];

  useFetchCargoVendor = true;
  cargoHash = "sha256-65jk8UlXZgQoxuwRcGlMnI4e+LpCJuP2TaqK+Kn4GnQ=";

  meta = with lib; {
    description = "Vendor-neutral implementation of RFC-0125's datatype and synthesis tooling";
    homepage = "https://git.lix.systems/lix-community/bootspec";
    license = licenses.mit;
    maintainers = [ lib.maintainers.raitobezarius ];
    platforms = platforms.unix;
  };
}