diff --git a/flake.lock b/flake.lock index ff69fb5..e328700 100644 --- a/flake.lock +++ b/flake.lock @@ -1,20 +1,5 @@ { "nodes": { - "crane": { - "locked": { - "lastModified": 1785782307, - "narHash": "sha256-MPaRdVkf6zZP5fCPxYCi8Dr4pZzgmXzg8T9nVEbp3Mw=", - "owner": "ipetkov", - "repo": "crane", - "rev": "2c71e194474d13de031d729b729c968ddbe3507f", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" @@ -51,7 +36,6 @@ }, "root": { "inputs": { - "crane": "crane", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index 827d996..5633e8c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,6 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - crane.url = "github:ipetkov/crane"; - flake-utils.url = "github:numtide/flake-utils"; }; @@ -14,7 +12,6 @@ let pkgs = import inputs.nixpkgs { inherit system; }; lib = pkgs.lib; - craneLib = inputs.crane.mkLib pkgs; cargoToml = fromTOML (builtins.readFile ./Cargo.toml); name = cargoToml.package.name; @@ -47,12 +44,6 @@ src = ./.; }; - # Build *just* the cargo dependencies, - # to reuse them for build and test derivations. - cargoArtifacts = craneLib.buildDepsOnly commonArgs; - - # Build the actual crate itself, - # reusing the dependency artifacts from above. crate = let desktopItem = pkgs.makeDesktopItem { @@ -62,10 +53,11 @@ exec = name; }; in - craneLib.buildPackage ( + pkgs.rustPlatform.buildRustPackage ( commonArgs // { - inherit cargoArtifacts; + inherit name; + cargoLock.lockFile = ./Cargo.lock; nativeBuildInputs = commonArgs.nativeBuildInputs ++ [ pkgs.autoPatchelfHook @@ -89,22 +81,18 @@ { packages.default = crate; - checks = { - crate-clippy = craneLib.cargoClippy ( - commonArgs - // { - inherit cargoArtifacts; - - cargoClippyExtraArgs = "-- --deny warnings"; - } - ); - }; - - devShells.default = craneLib.devShell { + devShells.default = pkgs.mkShell { LD_LIBRARY_PATH = lib.makeLibraryPath dlDeps; inputsFrom = [ crate ]; - packages = [ pkgs.rust-analyzer ]; + + packages = with pkgs; [ + rustc + cargo + clippy + rustfmt + rust-analyzer + ]; }; } );