49 lines
843 B
Nix
49 lines
843 B
Nix
{ lib
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
# Runtime Deps
|
|
, sqlite
|
|
, openssl
|
|
|
|
# Build Deps
|
|
, pkg-config
|
|
|
|
# Darwin Build Deps
|
|
, darwin
|
|
}:
|
|
|
|
let
|
|
rawManifest = builtins.readFile ./Cargo.toml;
|
|
manifest = builtins.fromTOML rawManifest;
|
|
in
|
|
rustPlatform.buildRustPackage {
|
|
pname = manifest.package.name;
|
|
version = manifest.package.version;
|
|
|
|
src = ./.;
|
|
|
|
cargoHash = "sha256-lBMe1TvkTJgN+q/9o7KId6w3CSxGl94Zcz7nxDqu9N0=";
|
|
|
|
nativeBuildInputs = [
|
|
openssl
|
|
pkg-config
|
|
] ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.SystemConfiguration;
|
|
|
|
buildInputs = [
|
|
openssl
|
|
sqlite
|
|
];
|
|
|
|
postInstall = /* bash */ ''
|
|
mkdir $out/dist
|
|
cp -r $src/dist/* $out/dist
|
|
'';
|
|
|
|
meta = {
|
|
description = "file sharing but with cats";
|
|
mainProgram = "nyazoom";
|
|
homepage = "https://nyazoom.zynh.me";
|
|
};
|
|
}
|