screencap-bot/flake.nix

49 lines
1.4 KiB
Nix
Raw Normal View History

{
description = "Screencap bot for Cohost";
outputs = { self, nixpkgs }: let
pkgs = import nixpkgs {
system = "x86_64-linux";
};
2023-06-30 16:33:41 -04:00
buildDeps = {
buildInputs = with pkgs; [ ffmpeg openssl ];
nativeBuildInputs = with pkgs; [ rustc cargo pkgconfig clang ];
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
};
2023-06-30 16:33:41 -04:00
pname = "screencap-bot";
version = "0.1";
in rec {
packages.x86_64-linux."${pname}-unwrapped" = pkgs.rustPlatform.buildRustPackage ({
inherit pname version;
src = ./.;
2023-07-01 20:05:33 -04:00
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"eggbug-0.1.3" = "sha256-dDnCJNnTJsah1HtrKoS5FxmHosBp5J6nfP4s7ugccog=";
};
};
2023-06-30 16:33:41 -04:00
} // buildDeps);
packages.x86_64-linux.${pname} = pkgs.symlinkJoin {
name = "${pname}-${version}";
paths = [ packages.x86_64-linux."${pname}-unwrapped" ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/${pname} \
--prefix PATH : ${pkgs.ffmpeg}/bin
'';
};
packages.x86_64-linux.default = packages.x86_64-linux.${pname};
2023-07-01 19:03:41 -04:00
devShells.x86_64-linux.default = pkgs.mkShell {
inherit (buildDeps) buildInputs LIBCLANG_PATH;
nativeBuildInputs = buildDeps.nativeBuildInputs ++ (with pkgs; [
cargo-audit
clippy
rustfmt
]);
};
};
}