{ description = "Micro Optical Spectrum Analyzer"; inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-23.05; outputs = { self, nixpkgs }: let pkgs = import nixpkgs { system = "x86_64-linux"; }; imgui_dir = "${pkgs.imgui}/include/imgui"; pocketfft = pkgs.fetchgit { url = "https://gitlab.mpcdf.mpg.de/mtr/pocketfft.git"; rev = "ecd78caa1c862e18fb1a55bcd4e30a05430b01f6"; hash = "sha256-xl7Tr1A1cqXhAL1Bljfk68R3AB1xOgkH15LHKxjYoSc="; }; in rec { packages.x86_64-linux.fastsa = pkgs.stdenv.mkDerivation { name = "fastsa"; src = self; nativeBuildInputs = [ pkgs.pkg-config ]; propagatedBuildInputs = [ pkgs.wayland pkgs.glfw-wayland pkgs.libffi pkgs.libbladeRF ]; preBuild = '' export IMGUI_DIR=${imgui_dir} export POCKETFFT_DIR=${pocketfft} ''; installPhase = '' mkdir -p $out/bin cp fastsa $out/bin ''; }; devShell.x86_64-linux = pkgs.mkShell { name = "fastsa-dev-shell"; buildInputs = packages.x86_64-linux.fastsa.nativeBuildInputs ++ packages.x86_64-linux.fastsa.propagatedBuildInputs; shellHook = packages.x86_64-linux.fastsa.preBuild; }; defaultPackage.x86_64-linux = packages.x86_64-linux.fastsa; }; }