add flakes
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
parent
dca96d2f2e
commit
0dbbc6a778
4 changed files with 151 additions and 0 deletions
39
default.nix
Normal file
39
default.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ lib, darwin, stdenv, openssl, pkg-config, rustPlatform, }:
|
||||
let cargoFile = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package;
|
||||
in rustPlatform.buildRustPackage {
|
||||
|
||||
pname = cargoFile.name; # The name of the package
|
||||
version = cargoFile.version; # The version of the package
|
||||
|
||||
# You can use lib here to make a more accurate source
|
||||
# this can be nice to reduce the amount of rebuilds
|
||||
# but thats out of scope for this post
|
||||
src = ./.; # The source of the package
|
||||
|
||||
# The lock file of the package, this can be done in other ways
|
||||
# like cargoHash, we are not doing it in this case because this
|
||||
# is much simpler, especially if we have access to the lock file
|
||||
# in our source tree
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
|
||||
# The runtime dependencies of the package
|
||||
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin
|
||||
(with darwin.apple_sdk.frameworks; [
|
||||
Security
|
||||
CoreFoundation
|
||||
SystemConfiguration
|
||||
]);
|
||||
|
||||
# programs and libraries used at build-time that, if they are a compiler or
|
||||
# similar tool, produce code to run at run-time—i.e. tools used to build the new derivation
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
cargoLock.outputHashes = {
|
||||
"mcp-core-1.0.7" = "sha256-I2lxsv71i/LLZN3r/7mwNc6nZRd1xtQNVUm/g08nhn0=";
|
||||
};
|
||||
|
||||
meta = {
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = cargoFile.name;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue