-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpackage.nix
More file actions
43 lines (42 loc) · 1001 Bytes
/
Copy pathpackage.nix
File metadata and controls
43 lines (42 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
lib,
rustPlatform,
stdenv,
cctools,
libllvm,
}:
let
fs = lib.fileset;
cargoMeta = lib.importTOML ./Cargo.toml;
cargoPackage = cargoMeta.package;
in
rustPlatform.buildRustPackage {
pname = cargoPackage.name;
version = cargoPackage.version;
src = fs.toSource {
root = ./.;
fileset = fs.intersection (fs.gitTracked ./.) (
fs.unions [
./src
./Cargo.lock
./Cargo.toml
]
);
};
cargoLock.lockFile = ./Cargo.lock;
env.INSTALL_NAME_TOOL =
if stdenv.hostPlatform.isDarwin then
"${cctools}/bin/install_name_tool"
else
"${libllvm}/bin/llvm-install-name-tool";
meta = {
description = "A darwin-compatible alternative to nix-bundle";
homepage = "https://codeberg.org/niklaskorz/nix-bundle-darwin";
license = lib.licenses.eupl12;
maintainers = with lib.maintainers; [
niklaskorz
];
mainProgram = "nix-bundle-darwin";
platforms = lib.platforms.darwin ++ lib.platforms.linux;
};
}