nixpkgs/pkgs/by-name/di/distrobuilder/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

82 lines
1.6 KiB
Nix
Raw Normal View History

{
lib,
buildGoModule,
callPackage,
cdrkit,
coreutils,
debootstrap,
fetchFromGitHub,
gnupg,
gnutar,
hivex,
makeWrapper,
nixosTests,
pkg-config,
squashfsTools,
2024-09-18 12:11:36 +00:00
stdenv,
wimlib,
}:
let
bins =
[
coreutils
debootstrap
gnupg
gnutar
squashfsTools
2024-09-18 12:11:36 +00:00
]
++ lib.optionals stdenv.hostPlatform.isx86_64 [
# repack-windows deps
cdrkit
hivex
wimlib
];
in
buildGoModule rec {
pname = "distrobuilder";
2024-10-24 03:07:31 +00:00
version = "3.1";
2024-10-24 03:07:31 +00:00
vendorHash = "sha256-3oHLvOdHbOdaL2FTo+a5HmayNi/i3zoAsU/du9h1N30=";
src = fetchFromGitHub {
owner = "lxc";
repo = "distrobuilder";
2023-10-27 16:56:52 +00:00
rev = "refs/tags/distrobuilder-${version}";
2024-10-24 03:07:31 +00:00
sha256 = "sha256-cIzIoLQmg1kgI1QRAmFh/ca88PJBW2yIY92BKHKwTMk=";
fetchSubmodules = false;
};
buildInputs = bins;
# tests require a local keyserver (mkg20001/nixpkgs branch distrobuilder-with-tests) but gpg is currently broken in tests
doCheck = false;
nativeBuildInputs = [
pkg-config
makeWrapper
] ++ bins;
postInstall = ''
wrapProgram $out/bin/distrobuilder --prefix PATH ":" ${lib.makeBinPath bins}
'';
passthru = {
tests = {
incus-legacy-init = nixosTests.incus.container-legacy-init;
incus-systemd-init = nixosTests.incus.container-systemd-init;
};
generator = callPackage ./generator.nix { inherit src version; };
};
meta = {
description = "System container image builder for LXC and LXD";
homepage = "https://github.com/lxc/distrobuilder";
license = lib.licenses.asl20;
maintainers = lib.teams.lxc.members;
platforms = lib.platforms.linux;
2023-11-23 21:09:35 +00:00
mainProgram = "distrobuilder";
};
}