working flake

This commit is contained in:
maxstrb 2026-02-24 21:43:08 +01:00
parent 0ff6a2dff8
commit 1402bea078
3 changed files with 30 additions and 33 deletions

View file

@ -1 +0,0 @@
/nix/store/dmyhdba7npfby7kzkg4h8w1k5xk4a6w0-source

View file

@ -0,0 +1 @@
/nix/store/kcr4344gjcn3bapm00x8mj1lcbq5ad0d-source

View file

@ -18,6 +18,30 @@
cargo = rustToolchain; cargo = rustToolchain;
rustc = 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 { in {
packages."${system}" = { packages."${system}" = {
default = rustPlatform.buildRustPackage { default = rustPlatform.buildRustPackage {
@ -25,46 +49,19 @@
version = "0.1.0"; version = "0.1.0";
src = ./.; src = ./.;
cargoLock.lockFile = ./Cargo.lock; cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = nativeTools;
nativeBuildInputs = with pkgs; [ buildInputs = buildLibs;
pkg-config
gcc
makeWrapper
];
buildInputs = with pkgs; [
libqalculate
];
postInstall = '' postInstall = ''
wrapProgram $out/bin/floating-calculator \ 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}" = { devShells."${system}" = {
default = pkgs.mkShell { default = pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = devTools ++ buildLibs;
gcc
gnumake
rustToolchain
evcxr
pkg-config
libqalculate
glib
];
VK_ICD_FILENAMES = "${pkgs.mesa}/share/vulkan/icd.d/intel_icd.x86_64.json"; VK_ICD_FILENAMES = "${pkgs.mesa}/share/vulkan/icd.d/intel_icd.x86_64.json";
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath runtimeLibs;
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (with pkgs; [
wayland
libxkbcommon
glib
vulkan-loader
mesa
libGL
]);
}; };
}; };
}; };