{ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, fenix, }: let pkgs = nixpkgs.legacyPackages.x86_64-linux // { ggwave = pkgs.stdenv.mkDerivation rec { pname = "ggwave"; version = "0.4.1"; src = pkgs.fetchFromGitHub { owner = "ggerganov"; repo = "ggwave"; rev = "${pname}-v${version}"; hash = "sha256-tymG9JC+Anb3D26EwMF8laz8xvGnrEA+tqMmGBAnY7o="; fetchSubmodules = true; }; nativeBuildInputs = [ pkgs.cmake ]; cmakeFlags = [ "-DGGWAVE_BUILD_EXAMPLES=OFF" "-DCMAKE_BUILD_TYPE=Release" ]; doCheck = true; installPhase = '' # for some reason nix won't copy the include even though cmake tells it to mkdir -p $out/include cp -r $src/include/* $out/include cmake --install . --prefix=$out ''; }; }; rustPkgs = fenix.packages.x86_64-linux.default; in with pkgs; { devShells.x86_64-linux.default = mkShell { packages = [ pkg-config cmake clang pkgs.ggwave ] ++ (with rustPkgs; [ cargo clippy rustc rustfmt ]); GGWAVE_PATH = "${pkgs.ggwave}"; LD_LIBRARY_PATH = "${pkgs.ggwave}/lib"; LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; }; }; }