{ 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"; in rec { packages.x86_64-linux.microsa = pkgs.stdenv.mkDerivation { name = "microsa"; src = self; nativeBuildInputs = [ pkgs.pkg-config ]; propagatedBuildInputs = [ pkgs.wayland pkgs.glfw-wayland pkgs.libffi pkgs.alsa-lib ]; preBuild = '' export IMGUI_DIR=${imgui_dir} ''; installPhase = '' mkdir -p $out/bin cp microsa $out/bin ''; }; devShell.x86_64-linux = pkgs.mkShell { name = "microsa-dev-shell"; buildInputs = [ pkgs.gnumake pkgs.gcc ] ++ packages.x86_64-linux.microsa.nativeBuildInputs ++ packages.x86_64-linux.microsa.propagatedBuildInputs; shellHook = packages.x86_64-linux.microsa.preBuild; }; defaultPackage.x86_64-linux = packages.x86_64-linux.microsa; }; }