cells/flake.nix

52 lines
1.6 KiB
Nix

{
description = "Cells";
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
llvm-tools-irrt = pkgs.runCommandNoCC "llvm-tools-irrt" {}
''
mkdir -p $out/bin
ln -s ${pkgs.llvmPackages_14.clang-unwrapped}/bin/clang $out/bin/clang-irrt
ln -s ${pkgs.llvmPackages_14.llvm.out}/bin/llvm-as $out/bin/llvm-as-irrt
'';
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 ./.;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"nac3ast-0.1.0" = "sha256-h8T+VbC0lohGz7YdO0c/Sn0UceVb3ghqd0IuxJR6Amo=";
};
};
nativeBuildInputs = [
pkgs.llvmPackages_14.llvm
llvm-tools-irrt
pkgs.makeWrapper
];
propagatedbuildInputs = [
pkgs.llvmPackages_14.llvm
pkgs.llvmPackages_14.lld
];
doCheck = false;
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
pkgs.rustfmt
pkgs.llvmPackages_14.llvm
pkgs.llvmPackages_14.lld
llvm-tools-irrt
];
shellHook = "export LD_LIBRARY_PATH=${libraryPath}";
};
};
}