Files
Decodal/package.nix
T
2026-08-12 05:42:45 +09:00

63 lines
1.2 KiB
Nix

{
lib,
rustPlatform,
}:
let
srcRoot = ./.;
srcRootString = toString srcRoot;
sourceFilter =
path: type:
let
pathString = toString path;
relPath = lib.removePrefix "${srcRootString}/" pathString;
baseName = baseNameOf pathString;
isExcludedTree = dir: relPath == dir || lib.hasPrefix "${dir}/" relPath;
in
!(
baseName == ".git"
|| baseName == "target"
|| baseName == "result"
|| isExcludedTree ".yoi"
|| isExcludedTree ".worktree"
);
in
rustPlatform.buildRustPackage {
pname = "decodal";
version = "0.1.2";
src = lib.cleanSourceWith {
src = srcRoot;
filter = sourceFilter;
};
cargoLock.lockFile = ./Cargo.lock;
strictDeps = true;
cargoBuildFlags = [
"-p"
"decodal-cli"
"-p"
"decodal-lsp"
];
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
test -x "$out/bin/decodal"
test -x "$out/bin/decodal-lsp"
"$out/bin/decodal" >/dev/null
runHook postInstallCheck
'';
meta = {
description = "Deferred Constraint Data Language";
license = lib.licenses.mit;
mainProgram = "decodal";
platforms = lib.platforms.unix;
};
}