flake worki :3

This commit is contained in:
Clara Dautermann 2025-07-08 01:03:45 +02:00
parent 17dec99395
commit c3768283d3
Signed by: clara
GPG key ID: 223391B52FAD4463

View file

@ -13,13 +13,28 @@
# Optionally pin to a specific commit of `nixpkgs-esp-dev`.
rev = "f37890edc9b327fcbc6d48c4cf174e65e4c0d148";
};
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ (import "${nixpkgs-esp-dev}/overlay.nix") ]; };
libxml2Shared = pkgs.libxml2.overrideAttrs (old: {
configureFlags = (old.configureFlags or [ ]) ++ [ "--enable-shared" ];
# cursed patch necessary to fix linking errors
postInstall = ''
ln -sf libxml2.so $out/lib/libxml2.so.2
${old.postInstall or ""}
'';
});
in
f { inherit pkgs libxml2Shared; }
);
in
{
devShells = forEachSupportedSystem
({ pkgs }: {
({ pkgs, libxml2Shared }: {
default = pkgs.mkShell
{
packages = with pkgs; [
@ -27,7 +42,23 @@
espflash
cargo-espflash
espup
llvmPackages_16.libclang # Explicitly add libclang
llvmPackages_16.clang # Include clang/headers
pkg-config # Often needed for bindgen to find clang
glibc.dev # Needed for C headers
libxml2Shared.out
ldproxy
];
env = {
# Set LD_LIBRARY_PATH so libstdc++.so.6 zlib and libxml2 can be found
LD_LIBRARY_PATH = with pkgs; pkgs.lib.makeLibraryPath [
gcc.cc.lib
zlib
libxml2Shared.out
];
};
};
});
};