Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
description = "Leet your code in command-line.";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
inputs.utils.url = "github:numtide/flake-utils";

outputs = { self, nixpkgs, rust-overlay, utils, ... }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ rust-overlay.overlay ]; };

platform = with pkgs; makeRustPlatform {
rustc = rust-bin.nightly.latest.minimal;
cargo = rust-bin.nightly.latest.minimal;
};
package = with pkgs; platform.buildRustPackage rec {
pname = "leetcode-cli";
version = "0.3.10";

src = fetchCrate {
inherit pname version;
sha256 = "SkJLA49AXNTpiWZByII2saYLyN3bAAJTlCvhamlOEXA=";
};

cargoSha256 = "xhKF4qYOTdt8iCSPY5yT8tH3l54HdkOAIS2SBGzqsdo=";

# a nightly compiler is required unless we use this cheat code.
RUSTC_BOOTSTRAP = 0;

# CFG_RELEASE = "${rustPlatform.rust.rustc.version}-nightly";
CFG_RELEASE_CHANNEL = "ngihtly";

nativeBuildInputs = [
pkg-config
rust-bin.stable.latest.default
];

buildInputs = [
openssl
dbus
sqlite
] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];

meta = with pkgs.lib; {
description = "Leet your code in command-line.";
homepage = "https://github.com/clearloop/leetcode-cli";
licenses = licenses.mit;
maintainers = with maintainers; [ congee ];
mainProgram = "leetcode";
};
};
in
{
defaultPackage = package;
overlay = final: prev: { leetcode-cli = package; };
}
);
}