2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, pkg-config
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, coreutils
|
|
|
|
, gnupg
|
|
|
|
, gnutar
|
|
|
|
, squashfsTools
|
|
|
|
, debootstrap
|
2024-01-02 11:29:13 +00:00
|
|
|
, callPackage
|
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
let
|
|
|
|
bins = [
|
|
|
|
coreutils
|
|
|
|
gnupg
|
|
|
|
gnutar
|
|
|
|
squashfsTools
|
|
|
|
debootstrap
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
2021-06-28 23:13:55 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "distrobuilder";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
vendorHash = "sha256-pFrEkZnrcx0d3oM1klQrNHH+MiLvO4V1uFQdE0kXUqM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lxc";
|
|
|
|
repo = "distrobuilder";
|
2024-01-02 11:29:13 +00:00
|
|
|
rev = "refs/tags/distrobuilder-${version}";
|
|
|
|
sha256 = "sha256-JfME9VaqaQnrhnzhSLGUy9uU+tki1hXdnwqBUD/5XH0=";
|
2021-06-28 23:13:55 +00:00
|
|
|
fetchSubmodules = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
buildInputs = bins;
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
# 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;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2021-06-28 23:13:55 +00:00
|
|
|
wrapProgram $out/bin/distrobuilder --prefix PATH ":" ${lib.makeBinPath bins}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
passthru = {
|
|
|
|
tests.incus = nixosTests.incus.container;
|
|
|
|
|
|
|
|
generator = callPackage ./generator.nix { inherit src version; };
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "System container image builder for LXC and LXD";
|
|
|
|
homepage = "https://github.com/lxc/distrobuilder";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = lib.teams.lxc.members;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
mainProgram = "distrobuilder";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|