Add nix files
This commit is contained in:
47
default.nix
Normal file
47
default.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
let
|
||||
rustOverlay = import (
|
||||
builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"
|
||||
);
|
||||
pkgsDefault = import <nixpkgs> { overlays = [ rustOverlay ]; };
|
||||
rustToolchain = pkgsDefault.rust-bin.stable."1.94.0".default;
|
||||
rustPlatformDefault = pkgsDefault.makeRustPlatform {
|
||||
cargo = rustToolchain;
|
||||
rustc = rustToolchain;
|
||||
};
|
||||
in
|
||||
{
|
||||
pkgs ? pkgsDefault,
|
||||
rustPlatform ? rustPlatformDefault,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "pile";
|
||||
version = "0.0.1";
|
||||
src = ./.;
|
||||
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
|
||||
buildInputs = [
|
||||
pkgs.pdfium-binaries
|
||||
pkgs.openssl
|
||||
]
|
||||
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
|
||||
pkgs.darwin.apple_sdk.frameworks.Security
|
||||
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgs.pkg-config
|
||||
pkgs.makeWrapper
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/pile \
|
||||
--prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath [ pkgs.pdfium-binaries ]}
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "pile - flexible file indexing";
|
||||
mainProgram = "pile";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user