Questions tagged [nix-shell]
29 questions
1
vote
0 answers
Download go modules Nix OS
I'm downloading a program from github and trying to build it. The program is written in go and uses external modules. After running the nix script, I get an error suggesting that I use the go get command. How can I get modules from a nix script?
My…

Sqler
- 55
- 3
1
vote
1 answer
nix-shell -p llvmPackages_8.stdenv doesn't have clang8 set in env
I'm trying to build a C++ project that requires a rather old version of clang, namely version 8.
That project doesn't have any default.nix or shell.nix.
I tried:
> nix-shell -p llvmPackages_8.stdenv
[nix-shell:~/git/the-project]$ clang…

lugggas
- 21
- 3
1
vote
1 answer
Nix shell #! to refer to to shell.nix in a parent directory
I start almost all my scripts lately with
#!/usr/bin/env nix-shell
#! nix-shell -i bash
set -e
But this requires that the default.nix/shell.nix be in the same directory as the script which is not always the case. Is there a way to tell nix-shell to…

fakedrake
- 6,528
- 8
- 41
- 64
1
vote
0 answers
python setup.py install inside a nix-shell
I have a shell built with nix-shell foo.nix. I would now like to install a python package with the classic python setup.py install. When I attempt this I get the message [Errno 13] Permission denied:…

alessandro
- 363
- 1
- 12
1
vote
1 answer
How to combine two shell.nix files?
I have the first shell.nix file:
{ pkgs ? import ./nix { }
, useClang ? false
, ae_name ? "ae"
}:
with pkgs;
(if useClang then tvb.aeClangStdenv else tvb.aeGccStdenv).mkDerivation rec {
name = ae_name;
nativeBuildInputs =…

Jaroslav Bezděk
- 6,967
- 6
- 29
- 46
1
vote
1 answer
ortools not found in nix-shell
Starting a nix-shell as follows
nix-shell -p python39Packages.ipython python39Packages.ortools --run ipython
Followed by
import ortools
results in
ModuleNotFoundError Traceback (most recent call…

dejakaymac
- 23
- 3
1
vote
1 answer
How to use nix-shell to install playwright from PyPi?
I am trying to create a nix-shell that installs python and playwright. My code does install python, but I cannot installed playwright properly.
with (import {});
let
playwright = pkgs.python38Packages.buildPythonPackage rec {
pname…

John Winston
- 1,260
- 15
- 30
1
vote
1 answer
how do you make `nix-shell` read from stdin?
interactive programs can typically read input from stdin, e.g.,
$ echo echo hello | bash
hello
or
$ echo 1 2 + p | dc
3
however, nix-shell does not seem to behave this way, e.g.
$ echo hello | nix-shell -p hello
$
whereas the expected output…

Björn Gohla
- 33
- 4
1
vote
1 answer
add bash so that it's recognized by /usr/bin/env
When I do which bash on NixOS, I get:
/run/current-system/sw/bin/bash
but I get this error:
env: can't execute 'bash': No such file or directory
Which is surely because of the use of a hashbang:
#!/usr/bin/env bash
I tried this:
export…
user11810894
0
votes
0 answers
Setting up python env for development and debugging in nixos
I have jumped the ship from arch to nixos and for compatibility with my server I am sticking with stable channel and using home-manager, yet to try flakes!!
Setting up python environment has been the biggest deterrent to completely shift to nixos,…

Immature trader
- 149
- 9
0
votes
0 answers
How can I update `nix-shell` development environment to work on systems other than NixOS?
I've got a working nix-shell for my NixOS machine that provides the necessary dependencies for the repository I'm working on. I'm trying to diversify it so that other machines can use it as well. I've tested it on an M1 MBP, my NixOS machine and a…

Chris O'Brien
- 29
- 6
0
votes
1 answer
How to refer to custom derivation in shell.nix?
I'm very new to Nix. I'd like to refer to project scripts in my shell.nix file, so that when I cd into my project directory I can refer to them by name, and I can keep them up-to-date whenever the sources change.
To learn how to do this, I created a…

haz
- 2,034
- 4
- 28
- 52
0
votes
0 answers
Build Lua package in nix-shell `shell.nix`
I'm trying to build for a nix-shell that aren't in the current nixpkgs repository.
Specifically: raylua
I've managed to get Raylib itself built as part of a nix-shell using Nim.
I'm trying to now modify this to use Lua Raylib and the Lua libraries…

Rebs
- 4,169
- 2
- 30
- 34
0
votes
1 answer
nix-shell can't find standard attribute
I'm running nixos 19.09 and trying to follow along with the instructions for creating a ruby package. But in one of the first steps I'm getting an error that the withPackages attribute can't be found.
Command:
$ nix-shell -p "ruby.withPackages (ps:…

goosetherumfoodle
- 25
- 5