diff --git a/.direnv/flake-inputs/dmyhdba7npfby7kzkg4h8w1k5xk4a6w0-source b/.direnv/flake-inputs/dmyhdba7npfby7kzkg4h8w1k5xk4a6w0-source deleted file mode 120000 index 9336577..0000000 --- a/.direnv/flake-inputs/dmyhdba7npfby7kzkg4h8w1k5xk4a6w0-source +++ /dev/null @@ -1 +0,0 @@ -/nix/store/dmyhdba7npfby7kzkg4h8w1k5xk4a6w0-source \ No newline at end of file diff --git a/.direnv/flake-inputs/kcr4344gjcn3bapm00x8mj1lcbq5ad0d-source b/.direnv/flake-inputs/kcr4344gjcn3bapm00x8mj1lcbq5ad0d-source new file mode 120000 index 0000000..7a82a67 --- /dev/null +++ b/.direnv/flake-inputs/kcr4344gjcn3bapm00x8mj1lcbq5ad0d-source @@ -0,0 +1 @@ +/nix/store/kcr4344gjcn3bapm00x8mj1lcbq5ad0d-source \ No newline at end of file diff --git a/flake.nix b/flake.nix index 243c0b5..d46ff19 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,30 @@ cargo = rustToolchain; rustc = rustToolchain; }; + runtimeLibs = with pkgs; [ + wayland + libxkbcommon + glib + vulkan-loader + mesa + libGL + ]; + buildLibs = with pkgs; [ + libqalculate + glib + ]; + nativeTools = with pkgs; [ + pkg-config + gcc + makeWrapper + ]; + devTools = with pkgs; [ + gcc + gnumake + rustToolchain + evcxr + pkg-config + ]; in { packages."${system}" = { default = rustPlatform.buildRustPackage { @@ -25,46 +49,19 @@ version = "0.1.0"; src = ./.; cargoLock.lockFile = ./Cargo.lock; - - nativeBuildInputs = with pkgs; [ - pkg-config - gcc - makeWrapper - ]; - - buildInputs = with pkgs; [ - libqalculate - ]; - + nativeBuildInputs = nativeTools; + buildInputs = buildLibs; postInstall = '' wrapProgram $out/bin/floating-calculator \ - --set LD_LIBRARY_PATH ${pkgs.lib.makeLibraryPath [pkgs.wayland pkgs.libxkbcommon]} + --set LD_LIBRARY_PATH ${pkgs.lib.makeLibraryPath runtimeLibs} ''; }; }; - devShells."${system}" = { default = pkgs.mkShell { - buildInputs = with pkgs; [ - gcc - gnumake - rustToolchain - evcxr - pkg-config - libqalculate - glib - ]; - + buildInputs = devTools ++ buildLibs; VK_ICD_FILENAMES = "${pkgs.mesa}/share/vulkan/icd.d/intel_icd.x86_64.json"; - - LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (with pkgs; [ - wayland - libxkbcommon - glib - vulkan-loader - mesa - libGL - ]); + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath runtimeLibs; }; }; };