Skip to content

Commit 9f8bbd7

Browse files
authored
Merge pull request #54 from camerondurham/master
Package as flake with deps to run on nix systems
2 parents 71731a1 + d12f8d8 commit 9f8bbd7

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ If you prefer to get the newest version and compile it yourself, follow these st
5959
cp resources/english.txt ~/.local/share/typy/
6060
```
6161

62+
If you have Nix with flakes enabled, you can install typy-cli directly:
63+
64+
```bash
65+
nix profile install github:Pazl27/typy-cli
66+
```
67+
68+
Or to run without installing:
69+
70+
```bash
71+
nix run github:Pazl27/typy-cli
72+
```
73+
6274
## Flags
6375
The `Typy` application supports the following flags:
6476

flake.lock

Lines changed: 82 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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

Comments
 (0)