From 5ebdf63b8639187a63389e8c02986a6b0fbd8189 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Mon, 1 Apr 2024 23:30:51 -0400 Subject: [PATCH] lxd-unwrapped: move to by-name and format --- .../lx/lxd-unwrapped/package.nix} | 73 ++++++++++++------- pkgs/top-level/all-packages.nix | 3 - 2 files changed, 45 insertions(+), 31 deletions(-) rename pkgs/{tools/admin/lxd/default.nix => by-name/lx/lxd-unwrapped/package.nix} (70%) diff --git a/pkgs/tools/admin/lxd/default.nix b/pkgs/by-name/lx/lxd-unwrapped/package.nix similarity index 70% rename from pkgs/tools/admin/lxd/default.nix rename to pkgs/by-name/lx/lxd-unwrapped/package.nix index 1ac34c7a1be9..1471f623307b 100644 --- a/pkgs/tools/admin/lxd/default.nix +++ b/pkgs/by-name/lx/lxd-unwrapped/package.nix @@ -1,22 +1,23 @@ -{ 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 { +buildGo122Module rec { pname = "lxd-unwrapped"; version = "5.21.0"; @@ -32,9 +33,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 +54,10 @@ buildGoModule rec { udev.dev ]; - ldflags = [ "-s" "-w" ]; + ldflags = [ + "-s" + "-w" + ]; tags = [ "libsqlite3" ]; preBuild = '' @@ -59,13 +71,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})]") @@ -86,7 +100,10 @@ buildGoModule rec { 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; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d977766a928a..85fbdd5ff5cf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10577,9 +10577,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 { };