Questions tagged [nix]

Nix is a purely functional package manager.

Nix is a purely functional package manager. This means that it treats packages like values in purely functional programming languages such as Haskell — they are built by functions that don’t have side-effects, and they never change after they have been built.

Home page: http://nixos.org/nix

770 questions
6
votes
1 answer

nix-shell: how to load environment variables from env file?

Related to this question: nix-shell: how to specify a custom environment variable? With this derivation: stdenv.mkDerivation rec { FOO = "bar"; } FOO will be available in the nix shell as an environment variable, but is it possible to load…
José Luis
  • 3,713
  • 4
  • 33
  • 37
6
votes
1 answer

Nix: How to override stdenv.cc with overlay globally?

I would like to override stdenv.cc to a specific GCC version (not necessarily in nixpkgs) globally using an overlay (i.e. without changing nixpkgs). Is there a way to do that? An overlay like this causes an infinite recursion (since package gcc49…
afarkas
  • 61
  • 2
6
votes
1 answer

When building a Haskell dependency with Nix, how to avoid building executables?

In my .nix file I have packages foo and bar, with bar depending on foo: let haskellPackages = reflex-platform.ghcjs.override { overrides = self: super: { foo = pkgs.haskell.lib.dontCheck (pkgs.haskell.lib.dontHaddock …
Emily
  • 2,577
  • 18
  • 38
6
votes
1 answer

Nix config outside of NixOS

So I’m trying to make a development environment that’s easily reproducible (staying away from home-manager currently to understand Nix better). After enough searching around I figured out how to make a few custom derivations, use buildEnv for…
Anrothan
  • 500
  • 5
  • 13
6
votes
2 answers

How can I enable Caddy plugins in NixOS?

I've just started playing with NixOS, and have so far managed to edit /etc/nixos/configuration.nix in my NixOS 18.09 VM to have PHP-FPM and the Caddy webserver enabled. { config, pkgs, ... }: { imports = […
David Oliver
  • 2,424
  • 1
  • 24
  • 37
6
votes
1 answer

How can I reset my nix environment to the original user profile?

I believe I ran nix-env -if example.nix which changed my nix environment. How can I undo this action? I'm trying to run a application that is specified in my nixos config (/etc/nixos/*), however it no longer seems available (within the…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
6
votes
1 answer

In NixOS, how can I resolve a collision?

I'm trying to set up a development environment with Python, including the Python libraries Spacy and Pandas. The command I'm trying to run is nix-shell -p 'python36.withPackages(ps: with ps; [ spacy pandas ])' But this is what happens: these…
Jonathan
  • 10,571
  • 13
  • 67
  • 103
6
votes
2 answers

How to install postgresql-client / psql on Nixos

I'm wondering how to install the psql command on NixOS. To be clear: I'm only interested in the client, not the server. I've looked at the derivation but couldn't find any pointers. Is there a way to create a derivation without building from…
Melle
  • 7,639
  • 1
  • 30
  • 31
6
votes
0 answers

Ubuntu 18 nixpkgs conda - relocation error libc.so.6 symbol _dl_exception_create, version GLIBC_PRIVATE ld-linux-x86-64.so.2 link time reference

the setup: system: "x86_64-linux" host os: Linux 4.15.0-22-generic, Ubuntu, 18.04 LTS (Bionic Beaver) multi-user?: no sandbox: no version: nix-env (Nix) 2.0.2 channels(aeug): "nixpkgs-18.09pre140731.c29d2fde74d" nixpkgs:…
InLaw
  • 2,537
  • 2
  • 21
  • 33
6
votes
1 answer

How to show where function was defined in nix?

Are there any way in nix to check where the function was defined, to see its source code? For example, I have function writeScript, how to check from where it came from?
srghma
  • 4,770
  • 2
  • 38
  • 54
6
votes
2 answers

How to debug nix-build errors for a custom nix file?

I'm trying to use Nix on Ubuntu 16.04. After setup, I try to build the following expression: let pkgs = import {}; stdenv = pkgs.stdenv; in rec { scalaEnv = stdenv.mkDerivation rec { name = "scala-env"; shellHook = '' …
bbarker
  • 11,636
  • 9
  • 38
  • 62
6
votes
2 answers

Nix: Querying packages' packages

I can query available packages w/ nix-env -qa [package] but how can I look for optional packages (e.g. libraries) that depend on a primary package and can be loaded or installed separately? Example: Coq (coq-8.6) has packages…
jaam
  • 900
  • 4
  • 23
6
votes
2 answers

How to override compile flags for a single package in nixos?

How can I override compile flags (as in CFLAGS) for a single package in NixOS/Nix environments? Here's what I've got by now: let optimizeForThisHost = pkg: pkgs.lib.overrideDerivation pkg (old: { exportOptimizations = '' …
musicmatze
  • 4,124
  • 7
  • 33
  • 48
6
votes
2 answers

Nix: what's the concrete difference between nixpkgs and nixpkgs.pkgs?

In: n = import {}; n contains an attribute n.pkgs, which also seems to contain all the available packages. What's the difference then between n and n.pkgs? It seems it's related to the fixpoint semantics of Nix configuration and the…
Yves Parès
  • 581
  • 5
  • 14
6
votes
2 answers

What is haskellng? What is the difference between 'haskellPackages' and 'haskellngPackages'?

I have been reading this StackOverflow post in which we are advised to use the haskellng package set. I have also read this but I did not understand what haskellng is. I have read this too, but I still don't know what haskellng is. Could someone…
jhegedus
  • 20,244
  • 16
  • 99
  • 167