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
9
votes
3 answers

How to `nix-build` again a built store path?

I create my own repository to fetch some git source. # packages.nix with (import {}); rec { rustcSource = fetchgit { url = https://github.com/rust-lang/rust; rev = "3191fbae9da539442351f883bdabcad0d72efcb6"; sha256 =…
Abdillah
  • 982
  • 11
  • 28
9
votes
1 answer

Inherit Attributes from Another Set in Nix Expression Language

In Nix manual's Inheriting attributes section, we have graphviz = (import ../tools/graphics/graphviz) { inherit fetchurl stdenv libpng libjpeg expat x11 yacc; inherit (xlibs) libXaw; }; xlibs = { libX11 = ...; libXaw = ...; ... } libpng…
Ben
  • 1,557
  • 13
  • 30
9
votes
1 answer

Mounting the same /nix directory on multiple machines

I want to consistently install software using the nix-package manager on multiple openSUSE machines (of different versions), of the same architecture. I am not root on any of the systems, but would want to convince our sysadmin to install nix in…
knedlsepp
  • 6,065
  • 3
  • 20
  • 41
9
votes
1 answer

Nix and Haskell-ng install error : attribute ‘nixpkgs’ in selection path ‘nixpkgs.haskellEnv’ not found

I am following this guide to set up nix and haskell-ng. But when I get to the step nix-env -iA nixpkgs.haskellEnv then I get the error: error: attribute ‘nixpkgs’ in selection path ‘nixpkgs.haskellEnv’ not found Any idea what is going wrong?
jhegedus
  • 20,244
  • 16
  • 99
  • 167
8
votes
1 answer

How to install fonts with Nix in Ubuntu

If I try something like nix-env --install nixpkgs.fira-code the package will be installed but the font will not be available anywhere. How do I install fonts and make them available for use in Ubuntu using Nix?
Marcelo Lazaroni
  • 9,819
  • 3
  • 35
  • 41
8
votes
1 answer

How does Nix's "callPackage" call functions defined without an ellipsis?

To call a Nix function that uses set destructuring, you need to pass it a set with exactly the keys it requires, no more and no less: nix-repl> ({ a }: a) { a = 4; b = 5; } error: anonymous function at (string):1:2 called with unexpected argument…
Chris Martin
  • 30,334
  • 10
  • 78
  • 137
8
votes
1 answer

Faster compilation for Haskell Miso

I use the Haskell Miso framework to write frontend web apps and the Nix compilation process takes a long time. How can I speed it up? Or what is the recommended approach to have a near instantaneous edit-compile-run cycle?
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
8
votes
2 answers

How can I use a nix configuration when not using Nixos?

So I've installed Nix on Arch linux and I'm able to run nix-env -i example, however how can I define a Nix configuration? As I don't have any /etc/nixos/configuration.nix file present. Is this possible? My goal here is to be able to define a…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
8
votes
1 answer

Build simple haskell library using nix

I've been interested in Nix for a while, and I thought I would finally try to use it for starting a new haskell project. I began with the directory structure project.cabal src/Lib.hs Where the cabal file has the following contents: name:…
phil
  • 1,416
  • 2
  • 13
  • 22
8
votes
1 answer

Nix: Can an installed package set a user environment variable?

I would like to define rc-files of my software via Nix. Therefore I define a new package in config.nix which will contain a config file: { pkgs, ... }: { packageOverrides = pkgs : with pkgs; { custom-config = import ./custom-config { inherit…
8
votes
2 answers

Nix tutorial on installing in home directory

I am trying to follow this tutorial, in order to install the Nix package manager in my home directory instead of /nix. I am doing the PRoot installation (see 2. in tutorial). At the end, the tutorial proposes to be smart in Building native packages…
mguijarr
  • 7,641
  • 6
  • 45
  • 72
7
votes
1 answer

Where is nix.conf located when installed on OSX?

I installed nix on osx using this command: $ sh <(curl https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume Following instructions here: https://hydra.nixos.org/build/119559243/download/1/manual/#sect-macos-installation I'm…
Brian Yeh
  • 3,119
  • 3
  • 26
  • 40
7
votes
1 answer

Haskell Cabal+Nix: Generate local documentation for all dependencies in a project

How can I generate documentation, possibly with a local hoogle server, with cabal and nix? I know there is a cabal new-haddock command, but it throws an error: cabal: renderBuildTargetProblem: unexpected status…
RowanStone
  • 160
  • 3
  • 11
7
votes
2 answers

Nix Pill 14: How to make callPackage overridable?

I am having trouble understanding Nix Pill 14. The author provides makeOverridable, and then challenges the user to integrate it with callPackage. makeOverridable and default.nix are provided, as follows, where makeOverridable is in the file…
webdavis
  • 83
  • 1
  • 5
7
votes
2 answers

Equivalent of passing `-p zlib` argument to `nix-shell` in `shell.nix`

If I build my Haskell project under nix-shell it gives error about missing zlib. If I build the project in nix-shell using nix-shell -p zlib then the project sees zlib and builds successfully. How can I add the zlib package to shell.nix file so that…
Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169