Unverified Commit 9ce41ef4 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

[Backport release-25.05] attic-server: don't depend on nix (#409477)

parents a289e66c 06c38d66
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -10,6 +10,11 @@
  installShellFiles,
  crates ? [ "attic-client" ],
}:
let
  # Only the attic-client crate builds against the Nix C++ libs
  # This derivation is also used to build the server
  needNixInclude = lib.elem "attic-client" crates;
in
rustPlatform.buildRustPackage {
  pname = "attic";
  version = "0-unstable-2025-02-02";
@@ -26,8 +31,7 @@ rustPlatform.buildRustPackage {
    installShellFiles
  ];

  buildInputs = [
    nixVersions.nix_2_24
  buildInputs = lib.optional needNixInclude nixVersions.nix_2_24 ++ [
    boost
  ];

@@ -35,8 +39,13 @@ rustPlatform.buildRustPackage {
  cargoHash = "sha256-AbpWnYfBMrR6oOfy2LkQvIPYsClCWE89bJav+iHTtLM=";
  useFetchCargoVendor = true;

  env =
    {
      ATTIC_DISTRIBUTOR = "nixpkgs";
    }
    // lib.optionalAttrs needNixInclude {
      NIX_INCLUDE_PATH = "${lib.getDev nixVersions.nix_2_24}/include";
    };

  # Attic interacts with Nix directly and its tests require trusted-user access
  # to nix-daemon to import NARs, which is not possible in the build sandbox.