build(nix): add nix build support

This commit is contained in:
Vladimir Rubin 2025-04-24 15:05:31 +03:00
parent d53732d337
commit be93543bb3
Signed by: vavakado
GPG key ID: CAB744727F36B524
2 changed files with 24 additions and 9 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/target
.direnv/
result

View file

@ -1,5 +1,6 @@
{
description = "DevShell for hinoirisetr";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
@ -20,19 +21,32 @@
pkgs = import nixpkgs {
inherit system overlays;
};
rust = pkgs.rust-bin.nightly.latest.default;
in
{
devShells.default =
with pkgs;
mkShell rec {
buildInputs = [
rust-bin.nightly.latest.default
];
devShells.default = pkgs.mkShell rec {
buildInputs = [
rust
];
shellHook = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${builtins.toString (pkgs.lib.makeLibraryPath buildInputs)}";
'';
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;
};
nativeBuildInputs = [ ];
buildInputs = [ ];
};
}
);
}