Skip to content

Commit

Permalink
Merge pull request #89 from NotLebedev/flake-fix
Browse files Browse the repository at this point in the history
Fix nix flake
  • Loading branch information
MalpenZibo authored Jan 23, 2025
2 parents 96103fa + e7c6579 commit 6e81713
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 55 deletions.
67 changes: 25 additions & 42 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
};
};

outputs = { self, crane, nixpkgs, flake-utils, rust-overlay }:
outputs = { crane, nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem
(system:
let
Expand All @@ -24,7 +24,7 @@

craneLib = crane.mkLib pkgs;

deps = with pkgs; [
buildInputs = with pkgs; [
rust-bin.stable.latest.default
rustPlatform.bindgenHook
pkg-config
Expand All @@ -36,34 +36,33 @@
vulkan-loader
];

libPath = with pkgs; lib.makeLibraryPath [
runtimeDependencies = with pkgs; [
libpulseaudio
wayland
mesa.drivers
vulkan-loader
libGL
];
in
with pkgs;
{
# `nix build` and `nix run`
defaultPackage = craneLib.buildPackage {
src = ./.;

nativeBuildInputs = [ pkgs.makeWrapper ];
nativeBuildInputs = with pkgs; [
makeWrapper
pkg-config
autoPatchelfHook # Add runtimeDependencies to rpath
];

buildInputs = deps;

postInstall = ''
wrapProgram "$out/bin/ashell" --prefix LD_LIBRARY_PATH : "${libPath}"
'';
inherit buildInputs runtimeDependencies;
};

# `nix develop`
devShells.default = mkShell {
buildInputs = deps;
devShells.default = pkgs.mkShell {
inherit buildInputs;

LD_LIBRARY_PATH = libPath;
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath runtimeDependencies;
};
}
);
Expand Down

0 comments on commit 6e81713

Please sign in to comment.