cells/flake.nix

41 lines
1.3 KiB
Nix
Raw Normal View History

2024-09-04 23:16:22 +08:00
{
description = "Cells";
2024-09-06 12:14:13 +08:00
inputs.nac3 = { type = "git"; url = "https://git.m-labs.hk/m-labs/nac3.git"; };
2024-09-04 23:16:22 +08:00
2024-09-06 12:14:13 +08:00
outputs = { self, nac3 }:
2024-09-04 23:16:22 +08:00
let
2024-09-06 12:14:13 +08:00
pkgs = import nac3.inputs.nixpkgs { system = "x86_64-linux"; };
2024-09-04 23:16:22 +08:00
libraryPath = pkgs.lib.makeLibraryPath [ pkgs.wayland pkgs.libxkbcommon pkgs.libGL ];
in {
packages.x86_64-linux.default = pkgs.rustPlatform.buildRustPackage {
name = "cells";
src = pkgs.lib.cleanSource ./.;
2024-09-06 12:14:13 +08:00
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"nac3ast-0.1.0" = "sha256-pUgwm4mgbXNh5QtkJ9+Fr55dKf3uRSpKeFwlvZz1OkQ=";
};
};
nativeBuildInputs = [
nac3.packages.x86_64-linux.llvm-nac3
nac3.packages.x86_64-linux.llvm-tools-irrt
pkgs.makeWrapper
];
buildInputs = [ nac3.packages.x86_64-linux.llvm-nac3 ];
2024-09-04 23:16:22 +08:00
postFixup = "wrapProgram $out/bin/cells --set LD_LIBRARY_PATH ${libraryPath}";
};
devShells.x86_64-linux.default = pkgs.mkShell {
name = "dev-shell-cells";
buildInputs = [
pkgs.cargo
pkgs.rustc
2024-09-07 10:06:00 +08:00
pkgs.rustfmt
2024-09-06 12:14:13 +08:00
nac3.packages.x86_64-linux.llvm-nac3
nac3.packages.x86_64-linux.llvm-tools-irrt
2024-09-04 23:16:22 +08:00
];
shellHook = "export LD_LIBRARY_PATH=${libraryPath}";
};
};
}