nix

nix-shell as #! interpreter for runghc

大城市里の小女人 提交于 2019-12-05 05:18:20
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 haskellPackages.HTTP import Network.HTTP main = return () I get the following result: [~:0]$ ./nixshelltest nixshelltest:4:1: error: Failed to load interface for ‘Network.HTTP’ Use -v to see a list of the files searched for. [~:1]$ to my mind, that's exactly what nix-shell -p is to avoid. Am I doing something wrong, missing the point, or is there a bug? This is both on a

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

痞子三分冷 提交于 2019-12-04 14:38:51
问题 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 resources, and I can't put the pieces together: Nixpkgs manual, 9.1. BEAM Languages (Erlang, Elixir & LFE) Elixir 1.5.1 with Erlang 20.0 on NixOS 18.03? Where do I specify the beam.packages.erlang<rel>.elixir exactly? Nixpkgs manual, 6.4. Modify

How to override 2 (two) packages in Nixos configuration.nix

十年热恋 提交于 2019-12-04 13:53:38
问题 I have some package to override in my configuration.nix. So I write the code as follows: nixpkgs.config = { allowUnfree = true; packageOverrides = { pkgs: rec { #mumble + pulse audio mumble = pkgs.mumble.override { pulseSupport = true; }; #kernel for intel ethernet and Testing e1000e package override linuxPackages.e1000e = pkgs.linuxPackages.e1000e.overrideDerivation (attrs: { name = "e1000e-3.3.3-${config.boot.kernelPackages.kernel.version}"; src = fetchurl { url = "https://www.dropbox.com/s

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

旧城冷巷雨未停 提交于 2019-12-04 05:27:15
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 "<nixpkgs>" -iA haskellPackages.turtle , however running ghci and import Turtle fails: Prelude> import Turtle <no location info>: error: Could not find module ‘Turtle’ It is not a module in the current program, or in any known package. Output of ghc-pkg list : /nix/store/fvf278s3lqsjv488ahhdi8jx6i0qzsr9-ghc-8.0.2/lib/ghc-8.0.2/package.conf.d Cabal-1.24.2.0 array-0.5.1.1 base-4.9.1

How to build a docker container with nix?

你说的曾经没有我的故事 提交于 2019-12-03 17:25:15
问题 I have a Nix package I'd like to bundle up into a docker container. Specifically, I want to use Nix as a more expressive alternative to a Dockerfile to have faster (non-linear) image builds. I've found documentation on dockerTools.buildImage but I'd like to have a minimal working example, and I'd also like to know what ends up being in the docker container. 回答1: The following example packages (using contents = ) the pkgs.nginx nixpkgs package into a docker container: docker load --input $(nix

How to override 2 (two) packages in Nixos configuration.nix

跟風遠走 提交于 2019-12-03 16:22:03
I have some package to override in my configuration.nix. So I write the code as follows: nixpkgs.config = { allowUnfree = true; packageOverrides = { pkgs: rec { #mumble + pulse audio mumble = pkgs.mumble.override { pulseSupport = true; }; #kernel for intel ethernet and Testing e1000e package override linuxPackages.e1000e = pkgs.linuxPackages.e1000e.overrideDerivation (attrs: { name = "e1000e-3.3.3-${config.boot.kernelPackages.kernel.version}"; src = fetchurl { url = "https://www.dropbox.com/s/pxx883hx9763ygn/e1000e-3.3.3.tar.gz?dl=0"; sha256 =

How to use Nix to setup a development environment?

筅森魡賤 提交于 2019-12-03 11:09:46
Let's say I need PostgreSQL 9.6.3 and Ruby 2.3.1 and various other tools. I can't find a tutorial that explains what I need to do. From the Nix manual, I seem to need to write a Nix expression to install the needed dependencies, but I can't make the leap from: { stdenv, fetchurl, perl }: stdenv.mkDerivation { name = "hello-2.1.1"; builder = ./builder.sh; src = fetchurl { url = ftp://ftp.nluug.nl/pub/gnu/hello/hello-2.1.1.tar.gz; md5 = "70c9ccf9fac07f762c24f2df2290784d"; }; inherit perl; } to the expression that will install the proper PostgreSQL and Ruby versions. It is absolutely unclear to

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

落爺英雄遲暮 提交于 2019-12-03 08:40:40
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 resources, and I can't put the pieces together: Nixpkgs manual, 9.1. BEAM Languages (Erlang, Elixir & LFE) Elixir 1.5.1 with Erlang 20.0 on NixOS 18.03? Where do I specify the beam.packages.erlang<rel>.elixir exactly? Nixpkgs manual, 6.4. Modify packages via packageOverrides Nix Pills, Chapter 14. Override Design Pattern Is this needed for this? In the

How to build a docker container with nix?

守給你的承諾、 提交于 2019-12-03 06:18:49
I have a Nix package I'd like to bundle up into a docker container. Specifically, I want to use Nix as a more expressive alternative to a Dockerfile to have faster (non-linear) image builds. I've found documentation on dockerTools.buildImage but I'd like to have a minimal working example, and I'd also like to know what ends up being in the docker container. The following example packages (using contents = ) the pkgs.nginx nixpkgs package into a docker container: docker load --input $(nix-build -E 'with import <nixpkgs> {}; pkgs.dockerTools.buildImage { name = "nix-htop"; contents = pkgs.htop;

how to add NixOS unstable channel declaratively in configuration.nix

本小妞迷上赌 提交于 2019-12-02 19:37:11
The NixOS cheatsheet describes how to install packages from unstable in configuration.nix . It starts off by saying to add the unstable channel like so: $ sudo nix-channel --add https://nixos.org/channels/nixpkgs-unstable $ sudo nix-channel --update Then, it is easy to use this channel in configuration.nix (since it should now be on NIX_PATH ): nixpkgs.config = { allowUnfree = true; packageOverrides = pkgs: { unstable = import <nixos-unstable> { config = config.nixpkgs.config; }; }; }; environment = { systemPackages = with pkgs; [ unstable.google-chrome ]; }; I would like to not have to do the