... oops forgot to format
This commit is contained in:
parent
17f428ec41
commit
f8477295a5
|
@ -1,18 +1,14 @@
|
||||||
# Based on original package.nix from zhaofengli
|
# Based on original package.nix from zhaofengli
|
||||||
|
|
||||||
{ lib, stdenv, rustPlatform
|
{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, installShellFiles, nix
|
||||||
, fetchFromGitHub
|
, boost, darwin
|
||||||
, pkg-config
|
|
||||||
, installShellFiles
|
|
||||||
, nix
|
|
||||||
, boost
|
|
||||||
, darwin
|
|
||||||
|
|
||||||
# Only build the client
|
# Only build the client
|
||||||
, clientOnly ? false
|
, clientOnly ? false
|
||||||
|
|
||||||
# Only build certain crates
|
# Only build certain crates
|
||||||
, crates ? if clientOnly then [ "attic-client" ] else [ "attic-client" "attic-server" ]
|
, crates ?
|
||||||
|
if clientOnly then [ "attic-client" ] else [ "attic-client" "attic-server" ]
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage {
|
rustPlatform.buildRustPackage {
|
||||||
|
@ -31,16 +27,10 @@ rustPlatform.buildRustPackage {
|
||||||
allowBuiltinFetchGit = true;
|
allowBuiltinFetchGit = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [ pkg-config installShellFiles ];
|
||||||
pkg-config
|
|
||||||
installShellFiles
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [ nix boost ] ++ lib.optionals stdenv.isDarwin
|
||||||
nix boost
|
(with darwin.apple_sdk.frameworks; [ SystemConfiguration ]);
|
||||||
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
|
||||||
SystemConfiguration
|
|
||||||
]);
|
|
||||||
|
|
||||||
cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates;
|
cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates;
|
||||||
|
|
||||||
|
@ -54,14 +44,15 @@ rustPlatform.buildRustPackage {
|
||||||
# Recursive Nix is not stable yet
|
# Recursive Nix is not stable yet
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
postInstall =
|
||||||
if [[ -f $out/bin/attic ]]; then
|
lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
||||||
installShellCompletion --cmd attic \
|
if [[ -f $out/bin/attic ]]; then
|
||||||
--bash <($out/bin/attic gen-completions bash) \
|
installShellCompletion --cmd attic \
|
||||||
--zsh <($out/bin/attic gen-completions zsh) \
|
--bash <($out/bin/attic gen-completions bash) \
|
||||||
--fish <($out/bin/attic gen-completions fish)
|
--zsh <($out/bin/attic gen-completions zsh) \
|
||||||
fi
|
--fish <($out/bin/attic gen-completions fish)
|
||||||
'';
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Multi-tenant Nix binary cache system";
|
description = "Multi-tenant Nix binary cache system";
|
||||||
|
|
Loading…
Reference in a new issue