2021-04-28 01:59:32 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildGoModule,
|
2024-09-17 19:18:02 +00:00
|
|
|
callPackage,
|
|
|
|
cdrkit,
|
2021-04-28 01:59:32 +00:00
|
|
|
coreutils,
|
2024-09-17 19:18:02 +00:00
|
|
|
debootstrap,
|
|
|
|
fetchFromGitHub,
|
2021-04-28 01:59:32 +00:00
|
|
|
gnupg,
|
|
|
|
gnutar,
|
2024-09-17 19:18:02 +00:00
|
|
|
hivex,
|
|
|
|
makeWrapper,
|
2023-10-27 16:58:50 +00:00
|
|
|
nixosTests,
|
2024-09-17 19:18:02 +00:00
|
|
|
pkg-config,
|
|
|
|
squashfsTools,
|
2024-09-18 12:11:36 +00:00
|
|
|
stdenv,
|
2024-09-17 19:18:02 +00:00
|
|
|
wimlib,
|
2018-06-30 16:46:00 +00:00
|
|
|
}:
|
2018-05-09 19:02:47 +00:00
|
|
|
|
2021-04-28 01:59:32 +00:00
|
|
|
let
|
|
|
|
bins =
|
|
|
|
[
|
|
|
|
coreutils
|
2024-09-17 19:18:02 +00:00
|
|
|
debootstrap
|
2021-04-28 01:59:32 +00:00
|
|
|
gnupg
|
|
|
|
gnutar
|
|
|
|
squashfsTools
|
2024-09-18 12:11:36 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isx86_64 [
|
|
|
|
# repack-windows deps
|
|
|
|
cdrkit
|
|
|
|
hivex
|
2024-09-17 19:18:02 +00:00
|
|
|
wimlib
|
2021-04-28 01:59:32 +00:00
|
|
|
];
|
2018-06-30 16:46:00 +00:00
|
|
|
in
|
2021-04-28 01:59:32 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "distrobuilder";
|
2024-10-24 03:07:31 +00:00
|
|
|
version = "3.1";
|
2018-05-09 19:02:47 +00:00
|
|
|
|
2024-10-24 03:07:31 +00:00
|
|
|
vendorHash = "sha256-3oHLvOdHbOdaL2FTo+a5HmayNi/i3zoAsU/du9h1N30=";
|
2018-05-09 19:02:47 +00:00
|
|
|
|
|
|
|
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=";
|
2021-04-28 01:59:32 +00:00
|
|
|
fetchSubmodules = false;
|
2018-05-09 19:02:47 +00:00
|
|
|
};
|
|
|
|
|
2021-04-28 01:59:32 +00:00
|
|
|
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;
|
2018-05-09 19:02:47 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2021-04-28 01:59:32 +00:00
|
|
|
wrapProgram $out/bin/distrobuilder --prefix PATH ":" ${lib.makeBinPath bins}
|
2018-05-09 19:02:47 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-27 16:58:50 +00:00
|
|
|
passthru = {
|
2024-03-01 22:48:18 +00:00
|
|
|
tests = {
|
2024-03-30 02:27:22 +00:00
|
|
|
incus-legacy-init = nixosTests.incus.container-legacy-init;
|
|
|
|
incus-systemd-init = nixosTests.incus.container-systemd-init;
|
2024-03-01 22:48:18 +00:00
|
|
|
};
|
2023-10-27 16:58:50 +00:00
|
|
|
|
|
|
|
generator = callPackage ./generator.nix { inherit src version; };
|
|
|
|
};
|
|
|
|
|
2023-11-02 03:23:56 +00:00
|
|
|
meta = {
|
2018-05-09 19:02:47 +00:00
|
|
|
description = "System container image builder for LXC and LXD";
|
|
|
|
homepage = "https://github.com/lxc/distrobuilder";
|
2023-11-02 03:23:56 +00:00
|
|
|
license = lib.licenses.asl20;
|
2023-12-02 14:38:44 +00:00
|
|
|
maintainers = lib.teams.lxc.members;
|
2023-11-02 03:23:56 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2023-11-23 21:09:35 +00:00
|
|
|
mainProgram = "distrobuilder";
|
2018-05-09 19:02:47 +00:00
|
|
|
};
|
|
|
|
}
|