nixos

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

stack build error: attribute ‘ghc822’ missing, at (string):1:53

牧云@^-^@ 提交于 2019-12-04 03:22:19
I am attempting to build my haskell project on NixOS. Running $ stack build gives the following error. $ stack build error: attribute ‘ghc822’ missing, at (string):1:53 (use ‘--show-trace’ to show detailed location information) What does this error mean and how could I proceed? When I run $ stack build --show-trace as suggested, I get the following output, which I do not understand either. $ stack build --show-trace Invalid option `--show-trace' Usage: stack build [TARGET] [--dry-run] [--pedantic] [--fast] [--ghc-options OPTIONS] [--flag PACKAGE:[-]FLAG] ([--dependencies-only] | [--only

use cabal2nix to create local nix environment for packages that aren't in nixpkgs

江枫思渺然 提交于 2019-12-03 19:58:49
I currently have a Yesod web application that I am developing on NixOS. I am using a default.nix file like described in O'Charles' blog post : { haskellPackages ? (import <nixpkgs> {}).haskellPackages }: haskellPackages.cabal.mkDerivation (self: { pname = "myblog"; version = "0.0.0"; src = ./.; isLibrary = true; isExecutable = true; buildDepends = with haskellPackages; [ aeson bson conduit dataDefault fastLogger hjsmin httpConduit monadControl monadLogger mongoDB persistent #persistentMongoDB persistentTemplate poolConduit shakespeare text waiExtra waiLogger warp yaml yesod yesodAuth yesodCore

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 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

What is the purpose of nix-instantiate? What is a store-derivation?

牧云@^-^@ 提交于 2019-11-30 12:12:26
In the manual it is written : The command nix-instantiate generates store derivations from (high-level) Nix expressions. But what are store derivations ? The manual says the following about store derivations : A description of a build action. The result of a derivation is a store object. Derivations are typically specified in Nix expressions using the derivation primitive. These are translated into low-level store derivations (implicitly by nix-env and nix-build, or explicitly by nix-instantiate) This is a little bit difficult to understand for a nix-newbee and I found nothing more

NixOS, Haskell, opengl : problems with building and running openGL programs

别等时光非礼了梦想. 提交于 2019-11-29 06:52:51
I'm experiencing a problem with GL on NixOS: the problem seems to be old, but there is still no straightforward solution yet in 2017! I'm trying to build a Haskell program using the Gloss library. I have installed gloss and everything it needs using the nix-shell -p mesa and it seems to be properly build and istalled (using cabal install ). However if I build the program in the same nix-shell it doesn't work: $ nix-shell -p mesa_glu [nix-shell:]$ ghc --make -O2 SnakePar.hs Linking SnakePar ... [nix-shell:]$ ./SnakePar SnakePar: user error (unknown GLUT entry glutInit) While working outside of

NixOS, Haskell, opengl : problems with building and running openGL programs

北战南征 提交于 2019-11-28 00:25:39
问题 I'm experiencing a problem with GL on NixOS: the problem seems to be old, but there is still no straightforward solution yet in 2017! I'm trying to build a Haskell program using the Gloss library. I have installed gloss and everything it needs using the nix-shell -p mesa and it seems to be properly build and istalled (using cabal install ). However if I build the program in the same nix-shell it doesn't work: $ nix-shell -p mesa_glu [nix-shell:]$ ghc --make -O2 SnakePar.hs Linking SnakePar ..

What is the purpose of nix-instantiate? What is a store-derivation?

混江龙づ霸主 提交于 2019-11-27 17:46:24
问题 In the manual it is written : The command nix-instantiate generates store derivations from (high-level) Nix expressions. But what are store derivations ? The manual says the following about store derivations : A description of a build action. The result of a derivation is a store object. Derivations are typically specified in Nix expressions using the derivation primitive. These are translated into low-level store derivations (implicitly by nix-env and nix-build , or explicitly by nix