Feature: Add nix shell (#1798)

This commit is contained in:
hodlwave 2022-07-14 03:55:03 -04:00 committed by GitHub
parent 4d2abc75f5
commit 1c066425da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View file

@ -7,6 +7,7 @@
- [Install dependencies:](#install-dependencies)
- [Ubuntu/Debian:](#ubuntudebian)
- [macOS:](#macos)
- [Nix:](#nix)
- [Arch:](#arch)
- [Fedora/CentOS:](#fedoracentos)
- [Windows](#windows)
@ -50,6 +51,8 @@ sudo apt install libusb-1.0-0-dev libudev-dev libffi-dev libssl-dev build-essent
```
brew install libusb
```
#### Nix:
The easiest way to get all necessary tools is to run `nix-shell` from the `utils` directory of this repository. You need to have [Nix](https://nixos.org/) installed.
#### Arch:
```
sudo pacman -Syu && sudo pacman -S libusb

21
utils/shell.nix Normal file
View file

@ -0,0 +1,21 @@
with import <nixpkgs> { };
with pkgs.python38Packages;
stdenv.mkDerivation {
name = "specter-desktop";
buildInputs = [
python38Full
python38Packages.virtualenv
python38Packages.pip
libusb1
];
shellHook = ''
cd ..
pip3 install virtualenv
virtualenv --python=python3 .env
source .env/bin/activate
pip3 install -r requirements.txt --require-hashes
pip3 install -e .
python3 setup.py install
'';
}