fastsa/flake.nix

37 lines
1.1 KiB
Nix
Raw Normal View History

2023-08-22 23:24:17 +08:00
{
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"; };
2023-08-23 11:08:54 +08:00
imgui_dir = "${pkgs.imgui}/include/imgui";
in rec {
packages.x86_64-linux.microsa = pkgs.stdenv.mkDerivation {
name = "microsa";
src = self;
nativeBuildInputs = [ pkgs.pkg-config ];
2023-08-23 18:44:23 +08:00
propagatedBuildInputs = [ pkgs.wayland pkgs.glfw-wayland pkgs.libffi pkgs.tinyalsa ];
2023-08-23 11:08:54 +08:00
preBuild = ''
export IMGUI_DIR=${imgui_dir}
2023-08-23 18:44:23 +08:00
export TINYALSA_DIR=${pkgs.tinyalsa}
2023-08-23 11:08:54 +08:00
'';
installPhase = ''
mkdir -p $out/bin
cp microsa $out/bin
'';
};
2023-08-22 23:24:17 +08:00
devShell.x86_64-linux = pkgs.mkShell {
name = "microsa-dev-shell";
buildInputs = [
pkgs.gnumake
pkgs.gcc
2023-08-23 11:08:54 +08:00
] ++ packages.x86_64-linux.microsa.nativeBuildInputs
++ packages.x86_64-linux.microsa.propagatedBuildInputs;
shellHook = packages.x86_64-linux.microsa.preBuild;
2023-08-22 23:24:17 +08:00
};
2023-08-23 11:08:54 +08:00
defaultPackage.x86_64-linux = packages.x86_64-linux.microsa;
2023-08-22 23:24:17 +08:00
};
}