62 lines
1.4 KiB
Nix
62 lines
1.4 KiB
Nix
{
|
|
description = "DevShell for hinoirisetr";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
nixpkgs,
|
|
rust-overlay,
|
|
flake-utils,
|
|
...
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
overlays = [ (import rust-overlay) ];
|
|
pkgs = import nixpkgs {
|
|
inherit system overlays;
|
|
};
|
|
rust = pkgs.rust-bin.selectLatestNightlyWith (
|
|
toolchain:
|
|
toolchain.default.override {
|
|
extensions = [ "rust-analyzer" ];
|
|
}
|
|
);
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell rec {
|
|
buildInputs = [
|
|
rust
|
|
pkgs.libnotify
|
|
];
|
|
|
|
shellHook = ''
|
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${builtins.toString (pkgs.lib.makeLibraryPath buildInputs)}";
|
|
'';
|
|
};
|
|
|
|
packages.default = pkgs.rustPlatform.buildRustPackage {
|
|
pname = "hinoirisetr";
|
|
version = "0.1.0";
|
|
|
|
src = ./.;
|
|
|
|
cargoLock = {
|
|
lockFile = ./Cargo.lock;
|
|
};
|
|
|
|
postFixup = ''
|
|
patchelf $out/bin/hinoirisetr --add-rpath ${pkgs.libnotify}/lib
|
|
'';
|
|
|
|
nativeBuildInputs = [ ];
|
|
buildInputs = [ pkgs.libnotify ];
|
|
};
|
|
}
|
|
);
|
|
}
|