From e809826dc8914f2f3df1530002eef7d717e89636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikodem=20Rabuli=C5=84ski?= Date: Thu, 1 May 2025 10:30:18 +0200 Subject: [PATCH] pkgs/conduit: remove dependency on fenix and crane --- flake.lock | 51 ++++------------------------------------ flake.nix | 10 +------- pkgs/conduit/default.nix | 33 ++++++++------------------ pkgs/default.nix | 2 -- 4 files changed, 16 insertions(+), 80 deletions(-) diff --git a/flake.lock b/flake.lock index 32a92b1..50d7464 100644 --- a/flake.lock +++ b/flake.lock @@ -45,9 +45,7 @@ }, "attic": { "inputs": { - "crane": [ - "crane" - ], + "crane": "crane", "flake-compat": "flake-compat", "flake-parts": "flake-parts", "lix": [ @@ -111,11 +109,11 @@ }, "crane": { "locked": { - "lastModified": 1742394900, - "narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=", + "lastModified": 1745454774, + "narHash": "sha256-oLvmxOnsEKGtwczxp/CwhrfmQUG2ym24OMWowcoRhH8=", "owner": "ipetkov", "repo": "crane", - "rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd", + "rev": "efd36682371678e2b6da3f108fdb5c613b3ec598", "type": "github" }, "original": { @@ -165,27 +163,6 @@ "type": "github" } }, - "fenix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1742452566, - "narHash": "sha256-sVuLDQ2UIWfXUBbctzrZrXM2X05YjX08K7XHMztt36E=", - "owner": "nix-community", - "repo": "fenix", - "rev": "7d9ba794daf5e8cc7ee728859bc688d8e26d5f06", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, "firefox-darwin": { "inputs": { "nixpkgs": [ @@ -609,10 +586,8 @@ "agenix": "agenix", "attic": "attic", "conduit-src": "conduit-src", - "crane": "crane", "darwin": "darwin", "disko": "disko", - "fenix": "fenix", "firefox-darwin": "firefox-darwin", "helix": "helix", "home-manager": "home-manager", @@ -629,23 +604,6 @@ "zjstatus": "zjstatus" } }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1742296961, - "narHash": "sha256-gCpvEQOrugHWLimD1wTFOJHagnSEP6VYBDspq96Idu0=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "15d87419f1a123d8f888d608129c3ce3ff8f13d4", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - }, "rust-overlay": { "inputs": { "nixpkgs": [ @@ -818,6 +776,7 @@ "zjstatus": { "inputs": { "crane": [ + "attic", "crane" ], "flake-utils": "flake-utils_3", diff --git a/flake.nix b/flake.nix index ea0a9e0..d83b902 100644 --- a/flake.nix +++ b/flake.nix @@ -47,13 +47,6 @@ url = "gitlab:famedly/conduit?ref=next"; flake = false; }; - fenix = { - url = "github:nix-community/fenix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - crane = { - url = "github:ipetkov/crane"; - }; firefox-darwin = { url = "github:bandithedoge/nixpkgs-firefox-darwin"; inputs.nixpkgs.follows = "nixpkgs"; @@ -64,7 +57,6 @@ attic = { url = "git+https://git.lix.systems/nrabulinski/attic.git"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.crane.follows = "crane"; inputs.lix.follows = "lix"; inputs.lix-module.follows = "lix-module"; }; @@ -75,7 +67,7 @@ zjstatus = { url = "github:dj95/zjstatus"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.crane.follows = "crane"; + inputs.crane.follows = "attic/crane"; }; lix = { url = "git+https://git.lix.systems/lix-project/lix.git"; diff --git a/pkgs/conduit/default.nix b/pkgs/conduit/default.nix index 2f1ccdd..387cf2d 100644 --- a/pkgs/conduit/default.nix +++ b/pkgs/conduit/default.nix @@ -1,10 +1,6 @@ { lib, stdenv, - pkgs, - system, - fenix, - crane, src, libiconv, rocksdb, @@ -12,27 +8,18 @@ rustPlatform, }: let - rust = - with fenix.${system}; - combine [ - stable.cargo - stable.rustc - ]; - crane' = (crane pkgs).overrideToolchain rust; - rocksdb' = rocksdb.overrideAttrs ( - final: prev: { - version = "9.1.1"; - src = prev.src.override { - rev = "v${final.version}"; - hash = "sha256-/Xf0bzNJPclH9IP80QNaABfhj4IAR5LycYET18VFCXc="; - }; - } - ); + manifest = (builtins.fromTOML (builtins.readFile "${src}/Cargo.toml")).package; in -crane'.buildPackage { +rustPlatform.buildRustPackage { + pname = manifest.name; + inherit (manifest) version; + inherit src; strictDeps = true; + useFetchCargoVendor = true; + cargoHash = "sha256-wESDxtKRMm/jyCr4kc20UuHGcE2s+OCMjfL+l1XihnA="; + nativeBuildInputs = [ rustPlatform.bindgenHook ]; buildInputs = lib.optionals stdenv.isDarwin [ @@ -42,8 +29,8 @@ crane'.buildPackage { ]; # Use system RocksDB - ROCKSDB_INCLUDE_DIR = "${rocksdb'}/include"; - ROCKSDB_LIB_DIR = "${rocksdb'}/lib"; + ROCKSDB_INCLUDE_DIR = "${rocksdb}/include"; + ROCKSDB_LIB_DIR = "${rocksdb}/lib"; NIX_OUTPATH_USED_AS_RANDOM_SEED = "randomseed"; CONDUIT_VERSION_EXTRA = src.shortRev; } diff --git a/pkgs/default.nix b/pkgs/default.nix index f5009d6..bd2f106 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -17,8 +17,6 @@ in package = import ./conduit; settings.args = { src = config.inputs.conduit-src.result; - crane = config.inputs.crane.result.mkLib; - fenix = config.inputs.fenix.result.packages; }; };