|
| 1 | +{ |
| 2 | + description = "typy-cli - Minimalistic Monkeytype clone for the CLI"; |
| 3 | + inputs = { |
| 4 | + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
| 5 | + rust-overlay = { |
| 6 | + url = "github:oxalica/rust-overlay"; |
| 7 | + inputs.nixpkgs.follows = "nixpkgs"; |
| 8 | + }; |
| 9 | + flake-utils.url = "github:numtide/flake-utils"; |
| 10 | + }; |
| 11 | + outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: |
| 12 | + flake-utils.lib.eachDefaultSystem (system: |
| 13 | + let |
| 14 | + overlays = [ (import rust-overlay) ]; |
| 15 | + pkgs = import nixpkgs { |
| 16 | + inherit system overlays; |
| 17 | + }; |
| 18 | + |
| 19 | + buildInputs = with pkgs; [ ]; |
| 20 | + |
| 21 | + nativeBuildInputs = with pkgs; [ |
| 22 | + rust-bin.stable.latest.default |
| 23 | + pkg-config |
| 24 | + makeWrapper |
| 25 | + ]; |
| 26 | + |
| 27 | + in |
| 28 | + { |
| 29 | + packages.default = pkgs.rustPlatform.buildRustPackage { |
| 30 | + pname = "typy-cli"; |
| 31 | + version = "0.7.0"; |
| 32 | + src = ./.; |
| 33 | + cargoLock = { |
| 34 | + lockFile = ./Cargo.lock; |
| 35 | + }; |
| 36 | + inherit buildInputs nativeBuildInputs; |
| 37 | + postInstall = '' |
| 38 | + mkdir -p $out/share/typy |
| 39 | + cp $src/resources/english.txt $out/share/typy/english.txt |
| 40 | +
|
| 41 | + wrapProgram $out/bin/typy-cli \ |
| 42 | + --run "mkdir -p ~/.local/share/typy" \ |
| 43 | + --run "cp -n $out/share/typy/english.txt ~/.local/share/typy/english.txt" |
| 44 | + ''; |
| 45 | + |
| 46 | + meta = with pkgs.lib; { |
| 47 | + description = "typy-cli - Minimalistic Monkeytype clone for the CLI"; |
| 48 | + homepage = "https://github.com/Pazl27/typy-cli"; |
| 49 | + license = licenses.mit; |
| 50 | + }; |
| 51 | + }; |
| 52 | + } |
| 53 | + ); |
| 54 | +} |
| 55 | + |
0 commit comments