refactor: split flake.nix into muiltple files

This commit is contained in:
link2xt
2026-05-25 05:14:36 +02:00
parent 2aba6aa339
commit 9be14448aa
11 changed files with 370 additions and 411 deletions

26
nix/libdeltachat.nix Normal file
View File

@@ -0,0 +1,26 @@
{ pkgs, fenixToolchain, rustSrc, cargoLock, fenixPkgs, version }:
let
rustPlatform = (pkgs.makeRustPlatform {
cargo = fenixToolchain;
rustc = fenixToolchain;
});
in
pkgs.stdenv.mkDerivation {
pname = "libdeltachat";
inherit version;
src = rustSrc;
cargoDeps = pkgs.rustPlatform.importCargoLock cargoLock;
nativeBuildInputs = [
pkgs.perl # Needed to build vendored OpenSSL.
pkgs.cmake
rustPlatform.cargoSetupHook
fenixPkgs.stable.rustc
fenixPkgs.stable.cargo
];
postInstall = ''
substituteInPlace $out/include/deltachat.h \
--replace __FILE__ '"${placeholder "out"}/include/deltachat.h"'
'';
}