diff --git a/.gitignore b/.gitignore index 6bc7078..1ce99de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /target .direnv -dist -result \ No newline at end of file +dist \ No newline at end of file diff --git a/flake.lock b/flake.lock index 44dc869..d0e21c2 100644 --- a/flake.lock +++ b/flake.lock @@ -1,66 +1,9 @@ { "nodes": { - "crane": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "nixpkgs": [ - "nixpkgs" - ], - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1692750383, - "narHash": "sha256-n5P5HOXuu23UB1h9PuayldnRRVQuXJLpoO+xqtMO3ws=", - "owner": "ipetkov", - "repo": "crane", - "rev": "ef5d11e3c2e5b3924eb0309dba2e1fea2d9062ae", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" }, - "locked": { - "lastModified": 1689068808, - "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, "locked": { "lastModified": 1681202837, "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", @@ -109,39 +52,13 @@ }, "root": { "inputs": { - "crane": "crane", "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay_2" + "rust-overlay": "rust-overlay" } }, "rust-overlay": { "inputs": { - "flake-utils": [ - "crane", - "flake-utils" - ], - "nixpkgs": [ - "crane", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1691374719, - "narHash": "sha256-HCodqnx1Mi2vN4f3hjRPc7+lSQy18vRn8xWW68GeQOg=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "b520a3889b24aaf909e287d19d406862ced9ffc9", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "rust-overlay_2": { - "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils", "nixpkgs": "nixpkgs_2" }, "locked": { @@ -172,21 +89,6 @@ "repo": "default", "type": "github" } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index dd97bc6..522ffd7 100644 --- a/flake.nix +++ b/flake.nix @@ -17,13 +17,9 @@ Updating `cargoHash`: inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; rust-overlay.url = "github:oxalica/rust-overlay"; - crane = { - url = "github:ipetkov/crane"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; - outputs = { self, nixpkgs, rust-overlay, crane }: + outputs = { self, nixpkgs, rust-overlay }: let overlays = [ (import rust-overlay) ]; system = "x86_64-linux"; @@ -74,29 +70,16 @@ Updating `cargoHash`: description = "A tool for generating dye sublimation transfer sheet SVGs for Japanese thumb shift 拇指シフト keycaps."; }; }); - dyesub-tool = let - rustToolchain = pkgs.rust-bin.nightly.latest.minimal.override { - targets = [ "wasm32-unknown-unknown" ]; - }; - craneLib = ((crane.mkLib pkgs).overrideToolchain rustToolchain).overrideScope' (final: prev: { - wasm-bindgen-cli = pkgs.wasm-bindgen-cli; - }); - crateNameFromCargoToml = packageName: craneLib.crateNameFromCargoToml { cargoToml = ./${packageName}/Cargo.toml; }; - in craneLib.buildTrunkPackage { - inherit (crateNameFromCargoToml "dyesub-tool") pname version; - src = with pkgs.lib; cleanSourceWith { - src = ./.; - filter = path: type: - (hasSuffix "\.html" path) || - (hasSuffix "\.css" path) || - (craneLib.filterCargoSources path type) - ; - }; - trunkIndexPath = "dyesub-tool/index.html"; + dyesub-tool = rustPlatformWasm.buildRustPackage (rustSettings // { + pname = "dyesub-tool"; + version = "0.1.0"; + buildAndTestSubdir = "dyesub-tool"; + buildInputs = with pkgs; [ trunk ]; + cargoHash = "sha256-KSBTEBHuWaenIVaKUMDRFToYxcTA/TFwsIG10WNP47g="; meta = meta // { description = "A tool for generating dye sublimation transfer sheet SVGs for Japanese thumb shift 拇指シフト keycaps."; }; - }; + }); }; }; }