From c447c0d83877907c3ade8a2e9b4f659d4ef92904 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Wed, 11 Oct 2023 21:22:10 +0200 Subject: [PATCH] chore: remove naersk dependency --- default.nix | 13 ++++++++----- flake.lock | 21 --------------------- flake.nix | 8 ++------ 3 files changed, 10 insertions(+), 32 deletions(-) diff --git a/default.nix b/default.nix index 4070bbf..d661a04 100644 --- a/default.nix +++ b/default.nix @@ -1,7 +1,7 @@ { lib -, naersk , stdenv , clangStdenv +, rustPlatform , hostPlatform , targetPlatform , pkg-config @@ -13,9 +13,14 @@ let cargoToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml)); in -naersk.lib."${targetPlatform.system}".buildPackage rec { +rustPlatform.buildRustPackage rec { src = ./.; - buildInputs = [ + cargoHash = "sha256-mXkNN5FJphPW/5cn3Fv/Nsfjkc3tssgcZZmHWCfEeYE="; + + name = "${cargoToml.package.name}"; + version = "${cargoToml.package.version}"; + + nativeBuildInputs = [ rustfmt pkg-config cargo @@ -23,9 +28,7 @@ naersk.lib."${targetPlatform.system}".buildPackage rec { ]; checkInputs = [ cargo rustc ]; - doCheck = true; - copyLibs = true; meta = { description = cargoToml.package.description; diff --git a/flake.lock b/flake.lock index bfe81fa..75bc4a5 100644 --- a/flake.lock +++ b/flake.lock @@ -1,25 +1,5 @@ { "nodes": { - "naersk": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1694081375, - "narHash": "sha256-vzJXOUnmkMCm3xw8yfPP5m8kypQ3BhAIRe4RRCWpzy8=", - "owner": "nmattia", - "repo": "naersk", - "rev": "3f976d822b7b37fc6fb8e6f157c2dd05e7e94e89", - "type": "github" - }, - "original": { - "owner": "nmattia", - "repo": "naersk", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1696757521, @@ -38,7 +18,6 @@ }, "root": { "inputs": { - "naersk": "naersk", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 153501a..fd3ad3a 100644 --- a/flake.nix +++ b/flake.nix @@ -3,19 +3,15 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - naersk = { - url = "github:nmattia/naersk"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; - outputs = { self, naersk, nixpkgs }: let + outputs = { self, nixpkgs }: let cargoToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml)); supportedSystems = ["x86_64-linux"]; forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); in { overlay = final: prev: { - "${cargoToml.package.name}" = final.callPackage ./. { inherit naersk; }; + "${cargoToml.package.name}" = final.callPackage ./. { }; }; packages = forAllSystems (system: -- 2.48.1