Files
continuwuity/nix/packages/default.nix
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.7 KiB
Nix
Raw Normal View History

2026-03-30 21:23:00 -04:00
{ inputs, ... }:
2025-09-24 14:33:20 +02:00
{
2025-10-21 19:17:55 +02:00
perSystem =
{
2026-03-30 21:23:00 -04:00
self',
pkgs,
lib,
...
}:
{
packages =
let
crane = self'.packages.crane;
src =
let
# see https://crane.dev/API.html#cranelibfiltercargosources
# we need to keep the `web` directory which would be filtered out by the regular source filtering function
# https://crane.dev/API.html#cranelibcleancargosource
isWebTemplate = path: _type: builtins.match ".*(src/(web|service)|docs).*" path != null;
isRust = crane.filterCargoSources;
isNix = path: _type: builtins.match ".+/nix.*" path != null;
webOrRustNotNix = p: t: !(isNix p t) && (isWebTemplate p t || isRust p t);
in
lib.cleanSourceWith {
src = inputs.self;
filter = webOrRustNotNix;
name = "source";
};
common = {
inherit src;
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.liburing ];
env.LIBCLANG_PATH = lib.makeLibraryPath [ pkgs.llvmPackages.libclang.lib ];
};
cargoArtifacts = crane.buildDepsOnly common;
2026-03-30 22:16:43 -04:00
rocksdb = pkgs.callPackage ./rocksdb.nix { };
2026-03-30 21:23:00 -04:00
continuwuity = crane.buildPackage (
common
// {
inherit cargoArtifacts;
2026-03-30 22:16:43 -04:00
env = {
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
};
2026-03-30 21:23:00 -04:00
}
);
in
{
default = continuwuity;
2026-03-30 22:16:43 -04:00
inherit rocksdb;
2026-03-30 21:23:00 -04:00
};
2025-10-21 19:17:55 +02:00
};
2025-09-24 14:33:20 +02:00
}