iced-template: replace crane

This commit is contained in:
electria 2026-08-03 12:18:59 -07:00
commit 0095d05e80
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs
2 changed files with 12 additions and 40 deletions

16
flake.lock generated
View file

@ -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"
}

View file

@ -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
];
};
}
);