|
2 | 2 | description = "Leet your code in command-line.";
|
3 | 3 |
|
4 | 4 | inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
5 | | - inputs.rust-overlay.url = "github:oxalica/rust-overlay"; |
6 | 5 | inputs.utils.url = "github:numtide/flake-utils";
|
7 | 6 |
|
8 | | - outputs = { self, nixpkgs, rust-overlay,utils, ... }: |
| 7 | + outputs = { self, nixpkgs, utils, ... }: |
9 | 8 | utils.lib.eachDefaultSystem (system:
|
10 | 9 | let
|
11 | | - pkgs = import nixpkgs { inherit system; overlays = [ rust-overlay.overlay ]; }; |
| 10 | + pkgs = import nixpkgs { inherit system; }; |
| 11 | + |
| 12 | + nativeBuildInputs = with pkgs; [ |
| 13 | + pkg-config |
| 14 | + ]; |
| 15 | + |
| 16 | + buildInputs = with pkgs; [ |
| 17 | + openssl |
| 18 | + dbus |
| 19 | + sqlite |
| 20 | + ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; |
12 | 21 |
|
13 | | - platform = with pkgs; makeRustPlatform { |
14 | | - rustc = rust-bin.nightly.latest.minimal; |
15 | | - cargo = rust-bin.nightly.latest.minimal; |
16 | | - }; |
17 | | - package = with pkgs; platform.buildRustPackage rec { |
18 | | - pname = "leetcode-cli"; |
19 | | - version = "0.3.10"; |
20 | 22 |
|
| 23 | + package = with pkgs; rustPlatform.buildRustPackage rec { |
| 24 | + pname = "leetcode-cli"; |
| 25 | + version = "0.3.11"; |
21 | 26 | src = fetchCrate {
|
22 | 27 | inherit pname version;
|
23 | | - sha256 = "SkJLA49AXNTpiWZByII2saYLyN3bAAJTlCvhamlOEXA="; |
| 28 | + sha256 = "sha256-DHtIhiRPRGuO6Rf1d9f8r0bMOHqAaJleUvYNyPiX6mc="; |
24 | 29 | };
|
| 30 | + cargoSha256 = "sha256-Suk/nQ+JcoD9HO9x1lYp+p4qx0DZ9dt0p5jPz0ZQB+k="; |
25 | 31 |
|
26 | | - cargoSha256="xhKF4qYOTdt8iCSPY5yT8tH3l54HdkOAIS2SBGzqsdo="; |
| 32 | + inheritbuildInputsnativeBuildInputs; |
27 | 33 |
|
28 | 34 | # a nightly compiler is required unless we use this cheat code.
|
29 | 35 | RUSTC_BOOTSTRAP = 0;
|
30 | 36 |
|
31 | | - # CFG_RELEASE = "${rustPlatform.rust.rustc.version}-nightly"; |
32 | | - CFG_RELEASE_CHANNEL = "ngihtly"; |
33 | | - |
34 | | - nativeBuildInputs = [ |
35 | | - pkg-config |
36 | | - rust-bin.stable.latest.default |
37 | | - ]; |
38 | | - |
39 | | - buildInputs = [ |
40 | | - openssl |
41 | | - dbus |
42 | | - sqlite |
43 | | - ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; |
| 37 | + # CFG_RELEASE = "${rustPlatform.rust.rustc.version}-stable"; |
| 38 | + CFG_RELEASE_CHANNEL = "stable"; |
44 | 39 |
|
45 | 40 | meta = with pkgs.lib; {
|
46 | 41 | description = "Leet your code in command-line.";
|
|
54 | 49 | {
|
55 | 50 | defaultPackage = package;
|
56 | 51 | overlay = final: prev: { leetcode-cli = package; };
|
| 52 | + |
| 53 | + devShell = with pkgs; mkShell { |
| 54 | + name = "shell"; |
| 55 | + inherit nativeBuildInputs; |
| 56 | + |
| 57 | + buildInputs = buildInputs ++ [ |
| 58 | + rustc |
| 59 | + cargo |
| 60 | + rustfmt |
| 61 | + clippy |
| 62 | + rust-analyzer |
| 63 | + cargo-edit |
| 64 | + cargo-bloat |
| 65 | + cargo-audit |
| 66 | + cargo-about |
| 67 | + cargo-outdated |
| 68 | + ]; |
| 69 | + |
| 70 | + PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; |
| 71 | + RUST_BACKTRACE = "full"; |
| 72 | + LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs; |
| 73 | + }; |
57 | 74 | }
|
58 | 75 | );
|
59 | 76 | }
|
0 commit comments