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
5
votes
1 answer

Nix shell: How to list the installed Haskell package versions

As a non-nix'er I installed the newest version of https://github.com/reflex-frp/reflex-platform. I think working in this nix-shell is a nice experience. Now I want to know which Haskell packages in which versions are installed and used in this…
Jogger
  • 1,617
  • 2
  • 12
  • 22
5
votes
3 answers

Overriding python with python3 in vim_configurable.customize

I am following this template for configuring my custom vim with Nix. My vim-config/default.nix is as follows: { pkgs }: let my_plugins = import ./plugins.nix { inherit (pkgs) vimUtils fetchFromGitHub; }; in with (pkgs // { python = pkgs.python3;…
Ben
  • 1,557
  • 13
  • 30
5
votes
3 answers

How to get OpenCV to work in nix?

I am trying to get an OpenCV hello world program to work using the nix package manager but its spewing out errors : OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If…
maou
  • 185
  • 6
5
votes
1 answer

Running postgres on osx using nix package manager

I'm using nix as a package manager on OSX. I've installed postgres. Now I'd like to start and stop the postgres server (and other related utilities). I can write a script to do this manually, and edit my config. But, is there a "best practice" way…
three-cups
  • 4,375
  • 3
  • 31
  • 41
5
votes
2 answers

where does haskell packages in nixpkgs go?

I once used nix-env -qaP to search for a haskell package. But since I updated my nix channel some time ago, all haskell packages gone. To be specific: qs@BF:~$ nix-channel --list nixpkgs…
TorosFanny
  • 1,702
  • 1
  • 16
  • 25
4
votes
2 answers

How to use postgresql in nixos

I've installed PostgreSQL: nix-env -iA nixos.postgresql Now when I use psql, I get: psql: error: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting…
4
votes
1 answer

How is vendorSha256 computed?

I'm trying to understand how the vendorSha256 is calculated when using buildGoModule. In nixpkgs manual the only info I get is: "vendorSha256: is the hash of the output of the intermediate fetcher derivation." Is there a way I can calculate the…
zuzuleinen
  • 2,604
  • 5
  • 38
  • 49
4
votes
1 answer

Is it possible to get Haskell stack to use Haskell packages provided by nix?

I'm developing a Haskell program that will eventually have some non-Haskell dependencies, and I heard that the nix integration in stack is one way to accomplish this. However, I'm now wondering if it's possible to use nix to install Haskell…
Jonathan Gallagher
  • 2,115
  • 2
  • 17
  • 31
4
votes
2 answers

How to specify package/derivation runtime dependencies with Nix?

I'm making a haskell program and I'm setting buildInput like this to include pkgs.ffmpeg-full: (myHaskellPackages.callCabal2nix "App" (./.) {}).overrideAttrs (oldAttrs: { buildInputs = (oldAttrs.buildInputs or []) ++ [ pkgs.ffmpeg-full…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
4
votes
1 answer

Is there a way to see the actual computed / generated "output" system configuration built and activated on NixOS?

So on NixOS we can edit the file /etc/nixos/configuration.nix to specify our "input" system configuration. However, when we run nixos-rebuild switch to build and activate our "input" configuration, then strictly speaking, the actual configuration…
maratbn
  • 188
  • 1
  • 9
4
votes
1 answer

how to specify host and build platform in a nix package (cross compiling in Nix)

I am new to Nix and struggling to grasp cross compilation concept with Nix. I understand that one can access the attributes stdenv.hostPlatform and buildPlatform in a Nix package and accordingly select libraries and tools. However I am confused…
Ankit
  • 1,075
  • 1
  • 8
  • 19
4
votes
1 answer

Nix Flake: how to accept the Android SDK License

I'm trying to use nix flakes for android development. This is my flake.nix: { description = "test"; outputs = { self, nixpkgs }: { packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello; devShell.x86_64-linux =…
Baju
  • 2,616
  • 1
  • 19
  • 29
4
votes
1 answer

MacOS: Shebang with absolute path not working

Selecting a Python interpreter using a shebang doesn't seem to work in some cases. I'm trying to use my python3.9 interpreter in a shebang (#!/...) on MacOS. See the Python-file below called…
Tobias Bergkvist
  • 1,751
  • 16
  • 20
4
votes
0 answers

How inject git revision into Nix derivation?

There are libraries such as gitrev, which allows to compile in git revision into executable file, but in case of using nix-build http://../master git meta data are missing in the source tree. How to reference derivation revision in such situation to…
Daniil Iaitskov
  • 5,525
  • 8
  • 39
  • 49
4
votes
1 answer

Can the same code and same compiler produce a different binary on different machines?

The idea of Nixos binary caches led me to considering this question. In nix, every compiled binary is associated with a hash key which is obtained from hashing all the dependencies and build script, i.e. a 'derivation' in nix-speak. That is my…
mherzl
  • 5,624
  • 6
  • 34
  • 75