packages/attic: init with unstable version
This commit is contained in:
parent
03993cb981
commit
30bba4f472
12
flake.lock
12
flake.lock
|
@ -2,11 +2,11 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1705204527,
|
||||
"narHash": "sha256-WVz9WdaFBhAwO/7A+HlW8HPJ4VQ8QnpCD1WZAcAPneo=",
|
||||
"lastModified": 1705666311,
|
||||
"narHash": "sha256-VYdSQm7zq3AStyHhRr3SBCTA8fVzrl6WtIlXTs2Wlts=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "dd5621df6dcb90122b50da5ec31c411a0de3e538",
|
||||
"rev": "a455c5fb3ee513e2f443838a0e84d52b035adb67",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -42,11 +42,11 @@
|
|||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1701680307,
|
||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
||||
"lastModified": 1705309234,
|
||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
}) names);
|
||||
}) // {
|
||||
overlays.default = final: prev: {
|
||||
attic = final.callPackage ./packages/attic { };
|
||||
attic-client = final.attic.override { clientOnly = true; };
|
||||
ipsw = final.callPackage ./packages/ipsw { };
|
||||
jlink = final.callPackage ./packages/jlink { };
|
||||
zephyrPackages = final.callPackage ./packages/zephyr { };
|
||||
|
|
5174
packages/attic/Cargo.lock
generated
Normal file
5174
packages/attic/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
73
packages/attic/default.nix
Normal file
73
packages/attic/default.nix
Normal file
|
@ -0,0 +1,73 @@
|
|||
# Based on original package.nix from zhaofengli
|
||||
|
||||
{ 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" ]
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "attic";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "zhaofengli";
|
||||
repo = "attic";
|
||||
rev = "fbe252a5c21febbe920c025560cbd63b20e24f3b";
|
||||
hash = "sha256-n9PK4O4X4S1JkwpkMuYm1wHZYJzRqif8g3RuVIPD+rY=";
|
||||
};
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
allowBuiltinFetchGit = true;
|
||||
};
|
||||
|
||||
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";
|
||||
|
||||
# Workaround for https://github.com/NixOS/nixpkgs/issues/166205
|
||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
||||
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
|
||||
};
|
||||
|
||||
# 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
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Multi-tenant Nix binary cache system";
|
||||
homepage = "https://github.com/zhaofengli/attic";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ zhaofengli ];
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue