From f8477295a53e491859e496549cc701f2527ebb79 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Sat, 20 Jan 2024 04:35:35 +0000 Subject: [PATCH] ... oops forgot to format --- packages/attic/default.nix | 47 +++++++++++++++----------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/packages/attic/default.nix b/packages/attic/default.nix index afc2b66..661ece3 100644 --- a/packages/attic/default.nix +++ b/packages/attic/default.nix @@ -1,18 +1,14 @@ # Based on original package.nix from zhaofengli -{ lib, stdenv, rustPlatform -, fetchFromGitHub -, pkg-config -, installShellFiles -, nix -, boost -, darwin +{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, installShellFiles, nix +, boost, darwin # Only build the client , clientOnly ? false -# Only build certain crates -, crates ? if clientOnly then [ "attic-client" ] else [ "attic-client" "attic-server" ] + # Only build certain crates +, crates ? + if clientOnly then [ "attic-client" ] else [ "attic-client" "attic-server" ] }: rustPlatform.buildRustPackage { @@ -30,18 +26,12 @@ rustPlatform.buildRustPackage { lockFile = ./Cargo.lock; allowBuiltinFetchGit = true; }; - - nativeBuildInputs = [ - pkg-config - installShellFiles - ]; - buildInputs = [ - nix boost - ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ - SystemConfiguration - ]); - + nativeBuildInputs = [ pkg-config installShellFiles ]; + + buildInputs = [ nix boost ] ++ lib.optionals stdenv.isDarwin + (with darwin.apple_sdk.frameworks; [ SystemConfiguration ]); + cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates; ATTIC_DISTRIBUTOR = "artemist"; @@ -54,14 +44,15 @@ rustPlatform.buildRustPackage { # Recursive Nix is not stable yet doCheck = false; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' - if [[ -f $out/bin/attic ]]; then - installShellCompletion --cmd attic \ - --bash <($out/bin/attic gen-completions bash) \ - --zsh <($out/bin/attic gen-completions zsh) \ - --fish <($out/bin/attic gen-completions fish) - fi - ''; + postInstall = + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + if [[ -f $out/bin/attic ]]; then + installShellCompletion --cmd attic \ + --bash <($out/bin/attic gen-completions bash) \ + --zsh <($out/bin/attic gen-completions zsh) \ + --fish <($out/bin/attic gen-completions fish) + fi + ''; meta = with lib; { description = "Multi-tenant Nix binary cache system";