mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-31 17:23:34 +00:00
Merge pull request #300862 from adamcstephens/lxd/lts
lxd: pin to LTS releases and rename
This commit is contained in:
commit
e456fbcfb2
@ -33,7 +33,7 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
package = lib.mkPackageOption pkgs "lxd" { };
|
||||
package = lib.mkPackageOption pkgs "lxd-lts" { };
|
||||
|
||||
lxcPackage = lib.mkPackageOption pkgs "lxc" {
|
||||
extraDescription = ''
|
||||
@ -139,7 +139,7 @@ in {
|
||||
ui = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "(experimental) LXD UI");
|
||||
|
||||
package = lib.mkPackageOption pkgs [ "lxd-unwrapped" "ui" ] { };
|
||||
package = lib.mkPackageOption pkgs [ "lxd-ui" ] { };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
148
pkgs/by-name/lx/lxd-lts/package.nix
Normal file
148
pkgs/by-name/lx/lxd-lts/package.nix
Normal file
@ -0,0 +1,148 @@
|
||||
{
|
||||
lib,
|
||||
lxd-unwrapped-lts,
|
||||
linkFarm,
|
||||
makeWrapper,
|
||||
stdenv,
|
||||
symlinkJoin,
|
||||
writeShellScriptBin,
|
||||
acl,
|
||||
apparmor-parser,
|
||||
apparmor-profiles,
|
||||
attr,
|
||||
bash,
|
||||
btrfs-progs,
|
||||
cdrkit,
|
||||
criu,
|
||||
dnsmasq,
|
||||
e2fsprogs,
|
||||
getent,
|
||||
gnutar,
|
||||
gptfdisk,
|
||||
gzip,
|
||||
iproute2,
|
||||
iptables,
|
||||
kmod,
|
||||
lvm2,
|
||||
minio,
|
||||
nftables,
|
||||
OVMF,
|
||||
qemu_kvm,
|
||||
qemu-utils,
|
||||
rsync,
|
||||
spice-gtk,
|
||||
squashfsTools,
|
||||
thin-provisioning-tools,
|
||||
util-linux,
|
||||
virtiofsd,
|
||||
xz,
|
||||
}:
|
||||
let
|
||||
binPath = lib.makeBinPath [
|
||||
acl
|
||||
attr
|
||||
bash
|
||||
btrfs-progs
|
||||
cdrkit
|
||||
criu
|
||||
dnsmasq
|
||||
e2fsprogs
|
||||
getent
|
||||
gnutar
|
||||
gptfdisk
|
||||
gzip
|
||||
iproute2
|
||||
iptables
|
||||
kmod
|
||||
lvm2
|
||||
minio
|
||||
nftables
|
||||
qemu_kvm
|
||||
qemu-utils
|
||||
rsync
|
||||
squashfsTools
|
||||
thin-provisioning-tools
|
||||
util-linux
|
||||
virtiofsd
|
||||
xz
|
||||
|
||||
(writeShellScriptBin "apparmor_parser" ''
|
||||
exec '${apparmor-parser}/bin/apparmor_parser' -I '${apparmor-profiles}/etc/apparmor.d' "$@"
|
||||
'')
|
||||
];
|
||||
|
||||
clientBinPath = [ spice-gtk ];
|
||||
|
||||
ovmf-2mb = OVMF.override {
|
||||
secureBoot = true;
|
||||
fdSize2MB = true;
|
||||
};
|
||||
|
||||
ovmf-4mb = OVMF.override {
|
||||
secureBoot = true;
|
||||
fdSize4MB = true;
|
||||
};
|
||||
|
||||
ovmf-prefix = if stdenv.hostPlatform.isAarch64 then "AAVMF" else "OVMF";
|
||||
|
||||
# mimic ovmf from https://github.com/canonical/lxd-pkg-snap/blob/3abebe1dfeb20f9b7729556960c7e9fe6ad5e17c/snapcraft.yaml#L378
|
||||
# also found in /snap/lxd/current/share/qemu/ on a snap install
|
||||
ovmf = linkFarm "lxd-ovmf" [
|
||||
{
|
||||
name = "OVMF_CODE.2MB.fd";
|
||||
path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_CODE.fd";
|
||||
}
|
||||
{
|
||||
name = "OVMF_CODE.4MB.fd";
|
||||
path = "${ovmf-4mb.fd}/FV/${ovmf-prefix}_CODE.fd";
|
||||
}
|
||||
{
|
||||
name = "OVMF_CODE.fd";
|
||||
path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_CODE.fd";
|
||||
}
|
||||
|
||||
{
|
||||
name = "OVMF_VARS.2MB.fd";
|
||||
path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd";
|
||||
}
|
||||
{
|
||||
name = "OVMF_VARS.2MB.ms.fd";
|
||||
path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd";
|
||||
}
|
||||
{
|
||||
name = "OVMF_VARS.4MB.fd";
|
||||
path = "${ovmf-4mb.fd}/FV/${ovmf-prefix}_VARS.fd";
|
||||
}
|
||||
{
|
||||
name = "OVMF_VARS.4MB.ms.fd";
|
||||
path = "${ovmf-4mb.fd}/FV/${ovmf-prefix}_VARS.fd";
|
||||
}
|
||||
{
|
||||
name = "OVMF_VARS.fd";
|
||||
path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd";
|
||||
}
|
||||
{
|
||||
name = "OVMF_VARS.ms.fd";
|
||||
path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd";
|
||||
}
|
||||
];
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "lxd-${lxd-unwrapped-lts.version}";
|
||||
|
||||
paths = [ lxd-unwrapped-lts ];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/lxd --prefix PATH : ${lib.escapeShellArg binPath}:${qemu_kvm}/libexec:$out/bin --set LXD_OVMF_PATH ${ovmf}
|
||||
|
||||
wrapProgram $out/bin/lxc --prefix PATH : ${lib.makeBinPath clientBinPath}
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit (lxd-unwrapped-lts) tests ui;
|
||||
};
|
||||
|
||||
inherit (lxd-unwrapped-lts) meta pname version;
|
||||
}
|
@ -1,11 +1,12 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchYarnDeps
|
||||
, nodejs
|
||||
, prefetch-yarn-deps
|
||||
, yarn
|
||||
, nixosTests
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchYarnDeps,
|
||||
nodejs,
|
||||
prefetch-yarn-deps,
|
||||
yarn,
|
||||
nixosTests,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
@ -1,23 +1,25 @@
|
||||
{ lib
|
||||
, hwdata
|
||||
, pkg-config
|
||||
, lxc
|
||||
, buildGoModule
|
||||
, fetchurl
|
||||
, acl
|
||||
, libcap
|
||||
, dqlite
|
||||
, raft-canonical
|
||||
, sqlite
|
||||
, udev
|
||||
, installShellFiles
|
||||
, nixosTests
|
||||
, gitUpdater
|
||||
, callPackage
|
||||
{
|
||||
lib,
|
||||
hwdata,
|
||||
pkg-config,
|
||||
lxc,
|
||||
buildGo122Module,
|
||||
fetchurl,
|
||||
acl,
|
||||
libcap,
|
||||
dqlite,
|
||||
raft-canonical,
|
||||
sqlite,
|
||||
udev,
|
||||
installShellFiles,
|
||||
nixosTests,
|
||||
gitUpdater,
|
||||
callPackage,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "lxd-unwrapped";
|
||||
buildGo122Module rec {
|
||||
pname = "lxd-unwrapped-lts";
|
||||
# major/minor are used in updateScript to pin to LTS
|
||||
version = "5.21.0";
|
||||
|
||||
src = fetchurl {
|
||||
@ -32,9 +34,17 @@ buildGoModule rec {
|
||||
--replace "/usr/share/misc/usb.ids" "${hwdata}/share/hwdata/usb.ids"
|
||||
'';
|
||||
|
||||
excludedPackages = [ "test" "lxd/db/generate" "lxd-agent" "lxd-migrate" ];
|
||||
excludedPackages = [
|
||||
"test"
|
||||
"lxd/db/generate"
|
||||
"lxd-agent"
|
||||
"lxd-migrate"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles pkg-config ];
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
pkg-config
|
||||
];
|
||||
buildInputs = [
|
||||
lxc
|
||||
acl
|
||||
@ -45,7 +55,10 @@ buildGoModule rec {
|
||||
udev.dev
|
||||
];
|
||||
|
||||
ldflags = [ "-s" "-w" ];
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
];
|
||||
tags = [ "libsqlite3" ];
|
||||
|
||||
preBuild = ''
|
||||
@ -59,13 +72,15 @@ buildGoModule rec {
|
||||
'';
|
||||
|
||||
preCheck =
|
||||
let skippedTests = [
|
||||
"TestValidateConfig"
|
||||
"TestConvertNetworkConfig"
|
||||
"TestConvertStorageConfig"
|
||||
"TestSnapshotCommon"
|
||||
"TestContainerTestSuite"
|
||||
]; in
|
||||
let
|
||||
skippedTests = [
|
||||
"TestValidateConfig"
|
||||
"TestConvertNetworkConfig"
|
||||
"TestConvertStorageConfig"
|
||||
"TestSnapshotCommon"
|
||||
"TestContainerTestSuite"
|
||||
];
|
||||
in
|
||||
''
|
||||
# Disable tests requiring local operations
|
||||
buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]")
|
||||
@ -77,17 +92,19 @@ buildGoModule rec {
|
||||
|
||||
passthru.tests.lxd = nixosTests.lxd;
|
||||
passthru.tests.lxd-to-incus = nixosTests.incus.lxd-to-incus;
|
||||
passthru.ui = callPackage ./ui.nix { };
|
||||
passthru.updateScript = gitUpdater {
|
||||
url = "https://github.com/canonical/lxd.git";
|
||||
rev-prefix = "lxd-";
|
||||
rev-prefix = "lxd-5.21";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Daemon based on liblxc offering a REST API to manage containers";
|
||||
homepage = "https://ubuntu.com/lxd";
|
||||
changelog = "https://github.com/canonical/lxd/releases/tag/lxd-${version}";
|
||||
license = with licenses; [ asl20 agpl3Plus ];
|
||||
license = with licenses; [
|
||||
asl20
|
||||
agpl3Plus
|
||||
];
|
||||
maintainers = teams.lxc.members;
|
||||
platforms = platforms.linux;
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, file, libuv
|
||||
, raft-canonical, sqlite, lxd }:
|
||||
, raft-canonical, sqlite, lxd-lts }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dqlite";
|
||||
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
|
||||
outputs = [ "dev" "out" ];
|
||||
|
||||
passthru.tests = {
|
||||
inherit lxd;
|
||||
inherit lxd-lts;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, file, libuv, lz4, lxd }:
|
||||
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, file, libuv, lz4, lxd-lts }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "raft-canonical";
|
||||
@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
|
||||
outputs = [ "dev" "out" ];
|
||||
|
||||
passthru.tests = {
|
||||
inherit lxd;
|
||||
inherit lxd-lts;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
@ -1,122 +0,0 @@
|
||||
{ lib
|
||||
, lxd-unwrapped
|
||||
, linkFarm
|
||||
, makeWrapper
|
||||
, stdenv
|
||||
, symlinkJoin
|
||||
, writeShellScriptBin
|
||||
, acl
|
||||
, apparmor-parser
|
||||
, apparmor-profiles
|
||||
, attr
|
||||
, bash
|
||||
, btrfs-progs
|
||||
, cdrkit
|
||||
, criu
|
||||
, dnsmasq
|
||||
, e2fsprogs
|
||||
, getent
|
||||
, gnutar
|
||||
, gptfdisk
|
||||
, gzip
|
||||
, iproute2
|
||||
, iptables
|
||||
, kmod
|
||||
, lvm2
|
||||
, minio
|
||||
, nftables
|
||||
, OVMF
|
||||
, qemu_kvm
|
||||
, qemu-utils
|
||||
, rsync
|
||||
, spice-gtk
|
||||
, squashfsTools
|
||||
, thin-provisioning-tools
|
||||
, util-linux
|
||||
, virtiofsd
|
||||
, xz
|
||||
}:
|
||||
let
|
||||
binPath = lib.makeBinPath [
|
||||
acl
|
||||
attr
|
||||
bash
|
||||
btrfs-progs
|
||||
cdrkit
|
||||
criu
|
||||
dnsmasq
|
||||
e2fsprogs
|
||||
getent
|
||||
gnutar
|
||||
gptfdisk
|
||||
gzip
|
||||
iproute2
|
||||
iptables
|
||||
kmod
|
||||
lvm2
|
||||
minio
|
||||
nftables
|
||||
qemu_kvm
|
||||
qemu-utils
|
||||
rsync
|
||||
squashfsTools
|
||||
thin-provisioning-tools
|
||||
util-linux
|
||||
virtiofsd
|
||||
xz
|
||||
|
||||
(writeShellScriptBin "apparmor_parser" ''
|
||||
exec '${apparmor-parser}/bin/apparmor_parser' -I '${apparmor-profiles}/etc/apparmor.d' "$@"
|
||||
'')
|
||||
];
|
||||
|
||||
clientBinPath = [
|
||||
spice-gtk
|
||||
];
|
||||
|
||||
ovmf-2mb = OVMF.override {
|
||||
secureBoot = true;
|
||||
fdSize2MB = true;
|
||||
};
|
||||
|
||||
ovmf-4mb = OVMF.override {
|
||||
secureBoot = true;
|
||||
fdSize4MB = true;
|
||||
};
|
||||
|
||||
ovmf-prefix = if stdenv.hostPlatform.isAarch64 then "AAVMF" else "OVMF";
|
||||
|
||||
# mimic ovmf from https://github.com/canonical/lxd-pkg-snap/blob/3abebe1dfeb20f9b7729556960c7e9fe6ad5e17c/snapcraft.yaml#L378
|
||||
# also found in /snap/lxd/current/share/qemu/ on a snap install
|
||||
ovmf = linkFarm "lxd-ovmf" [
|
||||
{ name = "OVMF_CODE.2MB.fd"; path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_CODE.fd"; }
|
||||
{ name = "OVMF_CODE.4MB.fd"; path = "${ovmf-4mb.fd}/FV/${ovmf-prefix}_CODE.fd"; }
|
||||
{ name = "OVMF_CODE.fd"; path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_CODE.fd"; }
|
||||
|
||||
{ name = "OVMF_VARS.2MB.fd"; path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd"; }
|
||||
{ name = "OVMF_VARS.2MB.ms.fd"; path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd"; }
|
||||
{ name = "OVMF_VARS.4MB.fd"; path = "${ovmf-4mb.fd}/FV/${ovmf-prefix}_VARS.fd"; }
|
||||
{ name = "OVMF_VARS.4MB.ms.fd"; path = "${ovmf-4mb.fd}/FV/${ovmf-prefix}_VARS.fd"; }
|
||||
{ name = "OVMF_VARS.fd"; path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd"; }
|
||||
{ name = "OVMF_VARS.ms.fd"; path = "${ovmf-2mb.fd}/FV/${ovmf-prefix}_VARS.fd"; }
|
||||
];
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "lxd-${lxd-unwrapped.version}";
|
||||
|
||||
paths = [ lxd-unwrapped ];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/lxd --prefix PATH : ${lib.escapeShellArg binPath}:${qemu_kvm}/libexec:$out/bin --set LXD_OVMF_PATH ${ovmf}
|
||||
|
||||
wrapProgram $out/bin/lxc --prefix PATH : ${lib.makeBinPath clientBinPath}
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit (lxd-unwrapped) tests ui;
|
||||
};
|
||||
|
||||
inherit (lxd-unwrapped) meta pname version;
|
||||
}
|
@ -748,6 +748,8 @@ mapAliases ({
|
||||
|
||||
lobster-two = google-fonts; # Added 2021-07-22
|
||||
luxcorerender = throw "'luxcorerender' has been removed as it's unmaintained and broken in nixpkgs since a while ago"; # Added 2023-06-07
|
||||
lxd = lib.warn "lxd has been renamed to lxd-lts" lxd-lts; # Added 2024-04-01
|
||||
lxd-unwrapped = lib.warn "lxd-unwrapped has been renamed to lxd-unwrapped-lts" lxd-unwrapped-lts; # Added 2024-04-01
|
||||
lzma = xz; # moved from top-level 2021-03-14
|
||||
|
||||
### M ###
|
||||
|
@ -10572,11 +10572,6 @@ with pkgs;
|
||||
|
||||
lxc = callPackage ../os-specific/linux/lxc { };
|
||||
|
||||
lxd = callPackage ../tools/admin/lxd/wrapper.nix { };
|
||||
lxd-unwrapped = callPackage ../tools/admin/lxd {
|
||||
buildGoModule = buildGo122Module;
|
||||
};
|
||||
|
||||
lxd-image-server = callPackage ../tools/virtualization/lxd-image-server { };
|
||||
|
||||
lzfse = callPackage ../tools/compression/lzfse { };
|
||||
|
Loading…
Reference in New Issue
Block a user