Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
37
flake.nix
37
flake.nix
@@ -44,22 +44,36 @@
|
|||||||
// flake-utils.lib.eachDefaultSystem (
|
// flake-utils.lib.eachDefaultSystem (
|
||||||
system:
|
system:
|
||||||
let
|
let
|
||||||
isDarwin = pkgs.stdenv.isDarwin;
|
|
||||||
|
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [ overlay ];
|
overlays = [ overlay ];
|
||||||
};
|
};
|
||||||
|
|
||||||
commonBuildInputs = with pkgs; [
|
isDarwin = pkgs.stdenv.isDarwin;
|
||||||
|
|
||||||
|
x11Libs = with pkgs; [
|
||||||
|
libX11
|
||||||
|
libXcursor
|
||||||
|
libXi
|
||||||
|
libXrandr
|
||||||
|
libxkbcommon
|
||||||
|
];
|
||||||
|
|
||||||
|
commonBuildInputs = with pkgs;
|
||||||
|
[
|
||||||
openssl
|
openssl
|
||||||
]
|
]
|
||||||
++ lib.optionals (!isDarwin) [
|
++ pkgs.lib.optionals (!isDarwin) (
|
||||||
pkgs.udev
|
[
|
||||||
];
|
udev
|
||||||
|
libGL
|
||||||
|
]
|
||||||
|
++ x11Libs
|
||||||
|
);
|
||||||
|
|
||||||
commonNativeBuildInputs = with pkgs; [
|
commonNativeBuildInputs = with pkgs; [
|
||||||
pkg-config
|
pkg-config
|
||||||
|
makeWrapper
|
||||||
];
|
];
|
||||||
|
|
||||||
singerPackage = pkgs.rustPlatform.buildRustPackage {
|
singerPackage = pkgs.rustPlatform.buildRustPackage {
|
||||||
@@ -67,11 +81,15 @@
|
|||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
|
|
||||||
src = pkgs.lib.cleanSource ./.;
|
src = pkgs.lib.cleanSource ./.;
|
||||||
|
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
|
||||||
nativeBuildInputs = commonNativeBuildInputs;
|
nativeBuildInputs = commonNativeBuildInputs;
|
||||||
buildInputs = commonBuildInputs;
|
buildInputs = commonBuildInputs;
|
||||||
|
|
||||||
|
postFixup = pkgs.lib.optionalString (!isDarwin) ''
|
||||||
|
wrapProgram $out/bin/singer \
|
||||||
|
--prefix LD_LIBRARY_PATH : "${pkgs.lib.makeLibraryPath commonBuildInputs}"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -86,7 +104,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
packages = (with pkgs; [
|
packages =
|
||||||
|
(with pkgs; [
|
||||||
rustToolchain
|
rustToolchain
|
||||||
cargo-deny
|
cargo-deny
|
||||||
cargo-edit
|
cargo-edit
|
||||||
@@ -96,6 +115,8 @@
|
|||||||
++ commonBuildInputs
|
++ commonBuildInputs
|
||||||
++ commonNativeBuildInputs;
|
++ commonNativeBuildInputs;
|
||||||
|
|
||||||
|
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath commonBuildInputs;
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export RUST_SRC_PATH="${pkgs.rustToolchain}/lib/rustlib/src/rust/library"
|
export RUST_SRC_PATH="${pkgs.rustToolchain}/lib/rustlib/src/rust/library"
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user