fastsa/flake.nix

41 lines
1.4 KiB
Nix

{
description = "Micro Optical Spectrum Analyzer";
inputs.nixpkgs.url = github:NixOS/nixpkgs;
outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs {
system = "x86_64-linux";
#config = { replaceStdenv = ({ pkgs }: pkgs.gcc13Stdenv); };
};
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.gcc13Stdenv.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.override { stdenv = pkgs.gcc13Stdenv; } {
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;
};
}