nix

Specifying Nix package runtime dependencies

▼魔方 西西 提交于 2019-12-11 02:29:00
问题 I've just started using the Nix package manager on OSX and I'm attempting to create my first package for the pass binary (https://www.passwordstore.org) - which is not available in the Nixpkgs repository. I'm attempting to specify a runtime dependency ( getopt ), however this doesn't appear to be available when the binary is used. This is my packages's default.nix: { pkgs ? import <nixpkgs> {} }: with pkgs; let version = "1.7.1"; in { pass = stdenv.mkDerivation rec { name = "pass-${version}";

Ensure Ruby version in Nix Dev Environment when using latest version

删除回忆录丶 提交于 2019-12-10 22:22:06
问题 Currently, the default and latest Ruby in Nix is 2.2.2-p0. When I run nix-env -qaP ruby it returns a list, which says that this ruby version is accessed via nixpkgs.ruby . I expect that this Ruby link will change to stay up-to-date with the latest supported ruby version. There is no optional nixpkgs.ruby_2_2_2 for me to use to ensure my ruby version. Looking at the .nix definition file at https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/ruby/ruby-2.2.2.nix, however,

What is a Nix expression in regard to Nix package management?

旧巷老猫 提交于 2019-12-10 15:46:51
问题 Even after reading the Nix manuals it is still confusing what Nix expressions really are. Sometimes they are referred to as derivations, but store derivations also mean something else. 回答1: In Nix, a Nix expression is just a general term for any type of value that you can write in the Nix language. A Nix expression can be a set, a list, a number, a string, a function, a name, a arithmetic operation, a function call, and much more. Nix expressions can contain other Nix expressions: for example

Build vim with a predefined list of plugins in Nix

穿精又带淫゛_ 提交于 2019-12-10 15:13:21
问题 So far I have been able to build vim with custom flags using vim_configurable nix package and setting the proper values in ~/.nixpkgs/config.nix . For instance, building vim with lua support (which isn't the default when installing vim nix package), is as simple as working with the config.vim set: pkgs : { vim = { lua = true; }; } The main problem I am facing now is how to set up Vim with different plugins for different nix profiles. What's the proper way to achieve this? Right now I am

What does the <nixpkgs> string / value mean in Nix?

五迷三道 提交于 2019-12-10 15:00:37
问题 For example in the following (which I assume is a nix expression): (import <nixpkgs> {}).haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [ lens aeson turtle ]) What does <nixpkgs> reference? I also see it used in other contexts for example: nix-shell '<nixpkgs>' -A linuxPackages.kernel 回答1: <nixpkgs> is a Nix expression that is evaluated by looking at the Nix search path in the NIX_PATH environment variable and/or -I option. It is described in more detail in the Nix manual. Note that the

install virtualbox modules from nixos-unstable in configuration.nix

自古美人都是妖i 提交于 2019-12-06 09:53:31
问题 It is possible to install packages from nixos-unstable in /etc/nixos/configuration.nix using the configuration from this answer. Here is an example of installing the htop packages from nixos-unstable: { config, pkgs, ... }: let unstableTarball = fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz; in { ... nixpkgs.config = { packageOverrides = pkgs: { unstable = import unstableTarball { config = config.nixpkgs.config; }; }; }; environment.systemPackages = with

Nix: Querying packages' packages

这一生的挚爱 提交于 2019-12-06 06:15:26
I can query available packages w/ nix-env -qa [package] but how can I look for optional packages (e.g. libraries) that depend on a primary package and can be loaded or installed separately? Example: Coq ( coq-8.6 ) has packages coqPackages_8_6.ssreflect and coqPackages_8_6.mathcomp that I can get no information about in Nix AFAIK I personally never use nix-env -qa because it is very slow. Instead, when I'm looking for a top-level package (an application), I use http://nixos.org/nixos/packages.html . When (like in your question), I'm looking for a non-top-level package, I use the auto

Import unstable and inherit config

与世无争的帅哥 提交于 2019-12-06 06:10:22
I have a package-upgrades.nix that I use to upgrade packages from unstable or a fork. {...}: { nixpkgs.config = { packageOverrides = let pkgsUnstable = import ( fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz ) { }; pkgsMaster = import ( fetchTarball https://github.com/NixOS/nixpkgs/archive/master.tar.gz ) { }; pkgsLocal = import ( fetchTarball https://github.com/moaxcp/nixpkgs/archive/local.tar.gz ) { }; in pkgs: rec { dropbox = pkgsUnstable.dropbox; jbake = pkgsUnstable.jbake; }; }; } This works well for things like windows manager. notion = pkgsUnstable

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

丶灬走出姿态 提交于 2019-12-06 04:02:41
问题 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 --nix Question : If I am using nix (NixOS in my case), is there any reason I will want to not use --nix argument? What is the nix way to deal with haskell project, should cabal (cabal2nix) be used in stead of stack ? I found that stack is rebuilding

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

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 00:08:09
问题 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