nix

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

牧云@^-^@ 提交于 2019-12-13 16:16:48
问题 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 a huge repo. Resources: How does Nix's “callPackage” call functions defined without an ellipsis? (Stackoverlow) Nix Pills, Chapter 13. Callpackage Design Pattern Nix 回答1: nix repl can tell you the location where a lambda is defined. $ nix repl

Cabal can't find foreign library when building on NixOS

做~自己de王妃 提交于 2019-12-12 13:30:42
问题 I am trying to build an internal Haskell project on NixOS using cabal2nix. It wraps (and thus depends on) a foreign library which on Ubuntu one would build by wget ting the source, then running make && make install && ldconfig . Thus when cabal goes to build the program, it is apparently able to find the appropriate header files (which are in /usr/local/include/ta-lib or /usr/include/ta-lib ). On Nix, the process as I understand is to setup a .nix file to specify how to get and build the

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

一笑奈何 提交于 2019-12-12 13:05:04
问题 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 functionality with just Nix packages. 回答1: From Nixpkgs you can use the buildEnv function to construct symlink farms similar to how nix-env produces them. This lets you group packages together into groups that you want to update separately. Of course a

Where should the builder script be located for a stand-alone nix expression?

江枫思渺然 提交于 2019-12-12 04:48:08
问题 I have a nix expression file ( .nix ) and a shell script builder, specified like: stdenv.mkDerivation rec { name = "my-env"; builder = './my-builder.sh'; ... ./my-builder.sh: No such file or directory when I run nix-build ./my-env.nix ; the nix expression file and builder scripts are sitting side-by-side in my home directory. My intent is to use this nix expression file to prepare an environment using nix-build and then to actually quickly run the environment whenever I want to use it (using

Nix does not trigger rebuild of coreutils

眉间皱痕 提交于 2019-12-11 18:42:55
问题 I am running Nix on top of Devuan GNU/Linux system (x86_64), with following ~/.nixpkgs/config.nix , as documented in Nix Pills: { packageOverrides = pkgs: { coreutils = pkgs.coreutils.override { aclSupport = false; attrSupport = false; selinuxSupport = false; }; coreutils2 = pkgs.coreutils.override { aclSupport = false; attrSupport = false; selinuxSupport = false; }; w3m = pkgs.w3m.override { graphicsSupport = false; imlib2 = null; x11Support = false; mouseSupport = true; }; }; } But when I

Override scripts in nix derivations

感情迁移 提交于 2019-12-11 08:53:18
问题 Is there a way to override scripts and/or configs in an existing derivation without having to recompile the whole package? I'd like to create a new version of gnome-session with modified $out/share/gnome-session/sessions/gnome.session modified. Using overridePackage I can change the preFixup phase, but this causes the whole gnome-session package to be recompiled. 回答1: A simple solution to problem is creating a new derivation without any sources. The trick is to create links to every file and

How do we refer to etc package from NixOS configuration?

前提是你 提交于 2019-12-11 07:13:11
问题 I want to get a path, which leads to nixos /etc location (any one of /run/current-system/etc or /nix/store/hashhere-etc-1.0 ). I use this path to configure pppd connect script, some kind of the following, environment.etc."huawei" = { text = '' /dev/ttyUSB0 38400 lock crtscts nodetach noipdefault # Below here what I've struggled connect ${pkgs.etc}/${environment.etc."huawei-script".target} ''; mode = "0777"; target = "ppp/peers/huawei"; }; I have tried to write ${pkgs.etc} or ${system.build

Acid-State example compiled error. No No instance for (Control.Monad.Reader.Class.MonadReader FailureDb (Query FailureDb))

左心房为你撑大大i 提交于 2019-12-11 06:19:28
问题 I was trying acid example but compile error. The error message says no instance No instance for MonadState, No instance for MonadReader . This article says it is due to two different mtl versions installed. And I am using nix-shell in nixos: ghc-pkg list | grep acid acid-state-0.14.3 ghc-pkg list | grep mtl mtl-2.2.1 mtl-2.2.2 However, if I don't use acid-state package when I enter nix-shell, I got: ghc-pkg list | grep mtl mtl-2.2.2 That probably means acid-state is using different mtl

nix user packages vs system packages

会有一股神秘感。 提交于 2019-12-11 03:26:56
问题 I use Vagrant + virtualBox and a Debian 8 / Ubuntu image for my development environments. I want to use nix for provisioning, but I can't get nixOS to work completely right (ie. with networking, provisioning...), but I'd more than happy to switch. So I'm falling back to nix + Debian 8 or nix + Ubuntu to mimic the production server. I can't quite get the differences between user packages and system packages and what is preferable to use in in my context, in order to be able to reuse that into

Workarounds for Haskell / cabal packages with constraints with Nix and Cabal?

我与影子孤独终老i 提交于 2019-12-11 02:59:54
问题 I recently got into developing with reflex-platform, with some extra configuration similar to what is described in the excellent reflex-project-skeleton. Now I am having a package conflict that I am unable to resolve. I use the same cabal script as reflex-project-skeleton , which invokes nix-shell in non-interactive mode with a cabal command. If I try ./cabal new-build --allow-newer all I get these derivations will be built: /nix/store/d6ji516i7pry5l6gv18y6hpj9k1bvgg5-heist-1.0.1.0.drv /nix