Skip to content

Commit

Permalink
[feat] use naersk to build package in flake
Browse files Browse the repository at this point in the history
  • Loading branch information
CutestNekoAqua authored Apr 17, 2024
1 parent 6ec80a7 commit e239863
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";

naersk.url = "github:nix-community/naersk";

# Dev tools
treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
Expand All @@ -23,6 +25,7 @@
libiconv
openssl
];
naersk' = pkgs.callPackage naersk {};
rust-toolchain = pkgs.symlinkJoin {
name = "rust-toolchain";
paths = [ pkgs.rustc pkgs.cargo pkgs.cargo-watch pkgs.rust-analyzer pkgs.rustPlatform.rustcSrc ];
Expand All @@ -33,10 +36,9 @@
in
{
# Rust package
packages.default = pkgs.rustPlatform.buildRustPackage {
packages.default = naersk'.buildPackage {
inherit (cargoToml.package) name version;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
buildInputs = nonRustDeps;
nativeBuildInputs = with pkgs; [
rust-toolchain
Expand Down

0 comments on commit e239863

Please sign in to comment.