diff --git a/flake.nix b/flake.nix index a35ee4a..3666de1 100644 --- a/flake.nix +++ b/flake.nix @@ -6,20 +6,30 @@ outputs = { self, nixpkgs }: let pkgs = import nixpkgs { system = "x86_64-linux"; }; - in { + 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 ]; + 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 - pkgs.pkg-config - pkgs.wayland - pkgs.glfw-wayland - pkgs.libffi - ]; - shellHook = '' - export IMGUI_DIR=${pkgs.imgui}/include/imgui - ''; + ] ++ 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; }; }