cells/flake.nix

52 lines
1.6 KiB
Nix
Raw Normal View History

2024-09-04 23:16:22 +08:00
{
description = "Cells";
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
2024-09-04 23:16:22 +08:00
outputs = { self, nixpkgs }:
2024-09-04 23:16:22 +08:00
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
'';
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 = {
2024-10-04 14:04:44 +08:00
"nac3ast-0.1.0" = "sha256-3+e6JTlhepXyD/BfSqq8pgjakLCjiBZAhvOiCNMqe5c=";
2024-09-06 12:14:13 +08:00
};
};
nativeBuildInputs = [
pkgs.llvmPackages_14.llvm
llvm-tools-irrt
2024-09-06 12:14:13 +08:00
pkgs.makeWrapper
];
propagatedbuildInputs = [
pkgs.llvmPackages_14.llvm
pkgs.llvmPackages_14.lld
];
doCheck = false;
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
pkgs.llvmPackages_14.llvm
pkgs.llvmPackages_14.lld
llvm-tools-irrt
2024-09-04 23:16:22 +08:00
];
shellHook = "export LD_LIBRARY_PATH=${libraryPath}";
};
};
}