nixos

NixOS beginner: xmonad and haskellmode in NixOS 14.04

╄→гoц情女王★ 提交于 2019-12-23 10:02:32
问题 I'm trying so set up a NixOS VM for code development in haskell, and got into troubles with the basic installation of both xmonad and emacs. The relevant part of my /etc/nixos/configuration.nix is environment.systemPackages = with pkgs; [ emacs emacs24Packages.haskellMode xlibs.xmessage haskellPackages.haskellPlatform.ghc haskellPackages.xmobar haskellPackages.xmonad haskellPackages.xmonadContrib haskellPackages.xmonadExtras ]; xmonad: when I try to compile the code, xmonad complains that it

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

时间秒杀一切 提交于 2019-12-21 05:40:37
问题 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

how to add NixOS unstable channel declaratively in configuration.nix

十年热恋 提交于 2019-12-20 09:31:33
问题 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; }; }; };

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

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

nixos + haskell + opengl (prerequisites)

假如想象 提交于 2019-12-11 06:55:26
问题 Unfortunately, I'm not getting a simple example program from this open gl tutorial to work. ghc --make gfx.hs Could not find module ‘Graphics.UI.GLUT’ [..] Then I tried the following: cabal install GLUT Warning: The package list for 'hackage.haskell.org' is 44.1 days old. Run 'cabal update' to get the latest list of available packages. Resolving dependencies... Configuring OpenGLRaw-3.2.2.0... Failed to install OpenGLRaw-3.2.2.0 Build log ( /home/m/.cabal/logs/OpenGLRaw-3.2.2.0.log ):

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

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}";

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