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

How do I override the libc in a Nix package to be musl?

I'm using Nix as a dependency manager for a Rust program. I have the following default.nix (simplified, but working): rec { pkgs = import {}; hello = pkgs.stdenv.mkDerivation rec { name = "rust-hello"; buildInputs = [ …
Julian Stecklina
  • 1,271
  • 1
  • 10
  • 24
5
votes
2 answers

Nix and GCC - `cannot find crt1.o`

I'm running Nix on WSL with Ubuntu 18.x. I installed GCC with $ nix-env -i gcc which installed gcc-7.3.0. I'm trying to use GCC to compile a simple CPP file (generated by Ferret). But GCC is coming up with the following error: $ g++ -std=c++11 -x…
Rebs
  • 4,169
  • 2
  • 30
  • 34
5
votes
2 answers

Unwanted bash newline nixos

I have installed NixOS 18.03. Bash seems to add a newline after every command. $ echo Hello, world! Hello, world! $ Why is this? How can I stop it??
5
votes
1 answer

Making a Simple Deb Package NixOS Compatible (Mathematica's wolframscript)

Consider this simple debian package: wolframscript.deb. After unpacking, it has the following file structure: ├── opt │   └── Wolfram │   └── WolframScript │   └── bin │   └── wolframscript └── usr ├── local │   └──…
George
  • 6,927
  • 4
  • 34
  • 67
5
votes
3 answers

What is the canonical way of installing Elixir or Erlang > 19 with `nix` on a non-NixOS system?

Please explain it as you would to a 10-year-old, from the point after the Nix package manager is installed on a non-NixOS machine. For example, I am on a Mac, and there isn't even a ~/.config directory. I found the following (probably) relevant…
toraritte
  • 6,300
  • 3
  • 46
  • 67
5
votes
2 answers

Reproducible nix-env -i with only Nix, no NixOS

I am only using Nix as a package manager and not using all of NixOS. I would like a reproducible nix-env -i package installation which can be shared and backed up. I am aware of using config.nix for for NixOS but I am looking for similar…
hackeryarn
  • 302
  • 3
  • 10
5
votes
1 answer

How to build Nix packages from source?

I think NixOS is great, but can't figure out how to build a package from source. Understanding the Nix expression language is not the problem, but to know what to put in a default.nix in order to build a package. Take for example the Nix expression…
ricky
  • 105
  • 1
  • 6
5
votes
1 answer

Import unstable and inherit config

I have a package-upgrades.nix that I use to upgrade packages from unstable or a fork. {...}: { nixpkgs.config = { packageOverrides = let pkgsUnstable = import ( fetchTarball…
John Mercier
  • 1,637
  • 3
  • 20
  • 44
5
votes
2 answers

How to build nix hello world

I'm trying to get started with a simple Hello World derivation using the Nix manual. But it's not clear to me how to go about building it. Is there somewhere I can download the source files from so I don't have to copy them line-by-line? Is there a…
dspyz
  • 5,280
  • 2
  • 25
  • 63
5
votes
1 answer

How to add package to cabal2nix generated `env`?

I use this default.nix to build my package with nix-build and get the env with nix-shell { pkgs ? import {} }: with pkgs; with haskellPackages; let myPackage = callPackage ./myPackage.nix {}; in if lib.inNixShell then myPackage.env…
wizzup
  • 2,361
  • 20
  • 34
5
votes
2 answers

composing local nix packages

I want to run a nix-shell with the following packages installed: aspell aspellDicts.en hello I can't simply do: nix-shell -p aspell aspellDicts.en hello --pure as this will not correctly install the aspell dictionaries. Nix provides a…
b73
  • 1,377
  • 2
  • 14
  • 25
5
votes
2 answers

How to install PostGIS within a Nix environment

I have the following shell.nix (to setup my development environment, no NixOS): with import {}; stdenv.mkDerivation { name = "my-shiny-project"; buildInputs = [ jq nodejs-6_x #postgis {version="2.3.1";} …
François Beausoleil
  • 16,265
  • 11
  • 67
  • 90
5
votes
1 answer

What is reason not to use stack --nix when I using nix?

I am on NixOS but I think this question should apply to any platform that use nix. I found by trial that stack can be used with couple options to build a project but I don't fully understand difference among them, stack stack --system-ghc stack…
wizzup
  • 2,361
  • 20
  • 34
5
votes
3 answers

How to replace paths to executables in source code with Nix that are not in PATH

I wish to write some Haskell that calls an executable as part of its work; and install this on a nixOS host. I don't want the executable to be in my PATH (and to rely on that would disrupt the beautiful dependency model of nix). If this were, say,…
user3416536
  • 1,429
  • 9
  • 20
5
votes
1 answer

XMonad on Nix - cannot find xmonad-contrib

I am trying to use nix on ubuntu, with XMonad as my window manager. I have this working well on one host using nixOS, but I have a second device that isn't yet ready for nixOS. nix on top of Ubuntu is mostly working well there, but xmonad cannot…
user3416536
  • 1,429
  • 9
  • 20