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
10
votes
2 answers

Nixos: How do I get get a python with debug info included with packages?

I'm trying to do cython debugging on NixOS. I can easily install cython in a nix-shell (chosen for simplicity of example), like this: $ nix-shell -p 'python27.withPackages( p: [ p.cython ])' $ cat…
Henry Crutcher
  • 2,137
  • 20
  • 28
10
votes
3 answers

What does the string / value mean in Nix?

For example in the following (which I assume is a nix expression): (import {}).haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [ lens aeson turtle ]) What does reference? I also see it used in other contexts for…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
10
votes
1 answer

How to run a `nix-shell` with a default.nix file?

I'm trying to understand how nix works. For that purposed I tried to create a simple environment to run jupyter notebooks. When I run the command: nix-shell -p "\ with import {};\ python35.withPackages (ps: [\ ps.numpy\ …
Rafael S. Calsaverini
  • 13,582
  • 19
  • 75
  • 132
10
votes
1 answer

Need help on start using purescript on NixOS

I am trying to setup hello world project with purescript on NixOs and have couple questions, Official purescript website recommend installation via npm but there is no nixos.nodePackages.purescript, instead there are at least 2 variants I found in…
wizzup
  • 2,361
  • 20
  • 34
9
votes
2 answers

How do I apply a nix-shell config in a docker image?

I’m trying to use Nix as a way of unifying my local development environment and the docker based Gitlab CI build that I’m using. I have a simple shell.nix that works perfectly - I can run nix-shell locally and get everything I need. If, in my CI…
WillW
  • 871
  • 6
  • 18
9
votes
1 answer

Nix overlays and override pattern

I have trouble understanding Nix overlays and the override pattern. What I want to do is add something to "patches" of gdb without copy/pasting the whole derivation. From Nix Pills I kind of see that override just mimics OOP, in reality it is just…
fiction
  • 448
  • 4
  • 11
9
votes
3 answers

Where is `callPackage` defined in the Nixpkgs repo (or how to find Nix lambda definitions in general)?

Found a lot of sources describing callPackage and some of its internals, but none that refers to it's location. It's like the best kept secret of Nix, and the manuals even seem to be actively avoiding the topic. I could find it given time, but it's…
toraritte
  • 6,300
  • 3
  • 46
  • 67
9
votes
2 answers

How do I search for Haskell packages using "nix search"?

I know that I can search for Haskell packages with nix-env by using nix-env -f '' -qaP -A haskellPackages name_of_package but that is slow and uncached. If I try to use the new command nix search all the Haskell packages are hidden. $ nix…
Hjulle
  • 2,471
  • 1
  • 22
  • 34
9
votes
1 answer

nix function to merge attributes / records recursively and concatenate arrays

Does someone know such function that merges list of records if all values to merge are records - merge them recursively if all values to merge are arrays - concatenate arrays If values can't be merged - the latter value is preferred Example…
srghma
  • 4,770
  • 2
  • 38
  • 54
9
votes
3 answers

NixOS within NixOS?

I'm starting to play around with NixOS deployments. To that end, I have a repo with some packages defined, and a configuration.nix for the server. It seems like I should then be able to test this configuration locally (I'm also running NixOS). I…
user2141650
  • 2,827
  • 1
  • 15
  • 23
9
votes
2 answers

With Nix, how can I specify Haskell dependencies with profiling enabled?

I was trying like this initially: nix-shell -p "haskell.packages.ghc821.ghcWithPackages (p: with p; [text hspec lens])" -j4 --run 'ghc Main.hs -prof Then GHC told me Main.hs:4:1: error: Could not find module ‘Control.Lens’ Perhaps you…
Wizek
  • 4,854
  • 2
  • 25
  • 52
9
votes
2 answers

How can I install a Haskell library to be accessible via GHCi with Nixos?

I've managed to install ghc with nix-env -i ghc. I'd like to install a Haskell library now, how should this be done? For example the turtle (https://hackage.haskell.org/package/turtle) library. I've run nix-env -f "" -iA…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
9
votes
1 answer

Generating a Nix package from a stack project

I have a software application that can be built and installed with stack. I would like to offer a binary package as well for Linux and Mac. For this purpose I'm considering nix, since, among other things, it can be used in Linux and Mac. This will…
Damian Nadales
  • 4,907
  • 1
  • 21
  • 34
9
votes
1 answer

nix-shell as #! interpreter for runghc

I'm trying to use nix-shell as a #! wrapper for runghc, as suggested in the manpage. But it cannot find the libraries. Given the following example, cut-down from the manpage #! /usr/bin/env nix-shell #! nix-shell -i runghc -p…
user3416536
  • 1,429
  • 9
  • 20
9
votes
2 answers

How to package a single Python script with nix?

I have a single Python script called myscript.py and would like to package it up as a nix derivation with mkDerivation. The only requirement is that my Python script has a run-time dependency, say, for the consul Python library (which itself depends…
nh2
  • 24,526
  • 11
  • 79
  • 128
1 2
3
51 52