Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(nix): add shell.nix to support nix builds #178

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ $ # Arch
$ pacman -S --needed gtk3 glib2 webkit2gtk-4.1 libsoup3
```

A `shell.nix` is provided for nix/NixOS builds; instructions are contained within the file [here](chat/shell.nix).

## Commands

- `:TabnineStatus` - to print Tabnine status
Expand Down
43 changes: 43 additions & 0 deletions chat/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# shell.nix
#
# this is a nix file which can create a shell with the dependencies necessary
# to build tabnine-chat. It assumes you're reasonably familiar with the nix
# toolchain.
#
# To use it:
#
# $ cd chat
# $ nix-shell
# these 11 paths will be fetched (156.39 MiB download, 739.97 MiB unpacked):
# /nix/store/z8dx4c6z528qi2w1p38yzg17g8q5jnln-cargo-1.77.2
# <snip...>
# [nix-shell]$ cargo build --release
# Compiling serde v1.0.164
# <snip...>
# Compiling tabnine_chat v0.1.0 (/home/sean/Work/tabnine-nvim/chat)
# Finished release [optimized] target(s) in 1m 42s
#
# built against 960fae2187687ff0929775ffedb6f05172b990d2 with nixos 24.05
#
# A flake could have been provided, but given that tabnine-nvim is often
# managed by lazy, can change quite frequently and is a bit divorced from the
# nix ecosystem, it seemed that a reasonable solution was just to support the
# cargo build process inside the chat directory.

{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell rec {
buildInputs = with pkgs; [
cargo
rustc
pkg-config
];

nativeBuildInputs = with pkgs; [
glib
gdk-pixbuf
libsoup_3
pango
gtk3
webkitgtk_4_1
];
}