Skip to content

Commit

Permalink
Merge pull request #486 from GDWR/GDWR/nix-flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Xithrius authored Oct 20, 2023
2 parents 694cd08 + de8ae57 commit 68ce224
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
# Ignore Vim temporary and swap files.
*.sw?
*~

# Ignore nix build output
result
10 changes: 10 additions & 0 deletions book/src/guide/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Installation

## Cargo

After [installing Rust](https://www.rust-lang.org/tools/install), use the following command to install twitch-tui:

```sh
Expand All @@ -13,3 +15,11 @@ Installing a version such as `2.0.0-alpha.1` would be `cargo install twitch-tui
(PPT and AUR repos coming soon)

To uninstall, run the command `cargo uninstall twitch-tui`.

## Nix

twitch-tui is also a [Nix Flake](https://nixos.wiki/wiki/Flakes)! You can build and run it on nix using:

```sh
nix run github:Xithrius/twitch-tui
```
27 changes: 27 additions & 0 deletions flake.lock

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

27 changes: 27 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
description = "Twitch chat in the terminal.";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
manifest = (pkgs.lib.importTOML ./Cargo.toml).package;
in {
packages.${system}.default = pkgs.rustPlatform.buildRustPackage {
pname = manifest.name;
version = manifest.version;

buildInputs = [pkgs.openssl.dev];
nativeBuildInputs = [pkgs.pkg-config];

src = pkgs.lib.cleanSource ./.;
cargoLock.lockFile = ./Cargo.lock;
};

apps.${system}.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/twt";
};
};
}

0 comments on commit 68ce224

Please sign in to comment.