{ description = "Rust libfossil bindings"; inputs = { systems.url = "github:nix-systems/x86_64-linux"; # nixpkgs.url = "github:nixos/nixpkgs?ref=24.05"; nixpkgs.url = "github:nixos/nixpkgs?rev=267d115a04e93a3487d3c2c26e3af5704a0144cc"; # lldb works here rust-overlay.url = "github:oxalica/rust-overlay"; flake-utils.url = "github:numtide/flake-utils"; libfossil.url = "git+https://git.sr.ht/~cgenie/libfossil-flake"; }; outputs = { self, nixpkgs, flake-utils, rust-overlay, systems, libfossil }@inputs: flake-utils.lib.eachDefaultSystem (system: let overlays = [ (import rust-overlay) ]; pkgs = import nixpkgs { inherit system overlays; }; cargo_run_app = { name }: ( let prog = pkgs.writeShellApplication { inherit name; # Our shell script name is ${name} # so it is available at $out/bin/${nameq} runtimeInputs = []; text = '' cargo run --bin ${name} --release -- "$@" ''; }; in { type = "app"; # Using a derivation in here gets replaced # with the path to the built output program = "${prog}/bin/${name}"; } ); in { devShells.default = pkgs.mkShell { buildInputs = [ libfossil.packages.${system}.default pkgs.gdb pkgs.llvmPackages_17.clang pkgs.llvmPackages_17.libclang pkgs.llvmPackages_17.libllvm pkgs.llvmPackages_17.lldb pkgs.llvmPackages_17.lldb.lib pkgs.llvmPackages_17.llvm pkgs.pkg-config pkgs.rust-bin.stable.latest.default pkgs.sqlite ]; LIBCLANG_PATH = "${pkgs.llvmPackages_17.libclang.lib}/lib"; }; packages.pkgs = pkgs; packages.libfossil = libfossil.packages.${system}.default; } ); }