This commit is contained in:
2026-09-13 18:40:55 +01:00
parent cc67cd25e9
commit aba6af03b4
2 changed files with 109 additions and 4 deletions
+23 -4
View File
@@ -22,7 +22,7 @@
flake-utils,
...
}@inputs:
flake-utils.lib.eachDefaultSystem (
(flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import inputs.nixpkgs {
@@ -105,16 +105,31 @@
# MY_CUSTOM_VAR = "some value";
}
);
# winit dlopens libwayland and wgpu the vulkan loader at runtime, which
# rpath alone does not cover; wrap the binary with LD_LIBRARY_PATH so
# the package also runs outside the devShell (e.g. from systemd).
barbar = pkgs.symlinkJoin {
name = "barbar-${my-crate.version}";
paths = [ my-crate ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/core \
--prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath guiLibs}
'';
meta.mainProgram = "core";
};
in
{
checks = {
inherit my-crate;
};
packages.default = my-crate;
packages.default = barbar;
apps.default = flake-utils.lib.mkApp {
drv = my-crate;
drv = barbar;
exePath = "/bin/core";
};
devShells.default = craneLib.devShell {
@@ -135,5 +150,9 @@
packages = guiLibs ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [ pkgs.mold ];
};
}
);
))
// {
# System-independent, so it lives outside eachDefaultSystem.
homeManagerModules.default = import ./nix/home-manager.nix self;
};
}