Questions tagged [nix]

Questions about Nix, the purely functional package manager and its usage and configuration.

Filter by
Sorted by
Tagged with
19
votes
3answers
8k views

How to find the name of a Nix package to install it in configuration.nix?

Suppose I search for a package to install using nix-env's --query operation: $ nix-env -qa 'aspell.*en' aspell-dict-en-7.1-0 I write this package name in /etc/nixos/configuration.nix, NixOS's main ...
17
votes
3answers
3k views

How do I create a local repository for NixOS/nixpkgs?

All the instructions I find for creating a local repository of Nix packages involve creating a local clone of the main nixpkgs repository and adding to that. Is there a way I can create a small ...
14
votes
1answer
3k views

How to split /etc/nixos/configuration.nix into separate modules?

Suppose I have a very simple NixOS configuration file: { config, pkgs, ... }: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix ]; # SOME ...
13
votes
2answers
1k views

How to find out which (not installed) package a file belongs to on NixOS?

I am using a Nix package manager on NixOS. Suppose I want to install a package that provides a file libgtk-x11-2.0.so.0. How do I find a package that provides this file, similar to other GNU/Linux ...
9
votes
3answers
2k views

Nix: Skipping unit tests when installing a Haskell package

I'm using Nix to install packages under my home (so no binary packages) on a shared host with limited resources. I'm trying to install git-annex. When building one of its dependencies, haskell-lens, ...
9
votes
1answer
1k views

How do you install a one-off package in NixOS?

I've got a NixOS box that I keep on the nixos-16.03 channel. I want the machine to stay in a mostly-stable state, and so I am wanting to avoid switching to the nixos-unstable channel. However, I ...
8
votes
2answers
7k views

How to use libraries installed by nix at run-time?

I'm using nix in "single-user mode" in a system where I'm not the root (see below for a description of my nix setup). I wanted to quickly run one of my binaries which is dynamically linked with a ...
8
votes
1answer
339 views

Preventing Nix from upgrading git to git-full

I'm using Nix on Ubuntu to have more modern versions of some packages, one of them being git. When I'm run nix-env -u, this is what happens: % nix-env -u --dry-run '*' (dry run; not doing anything) ...
7
votes
4answers
1k views

How does Nix manage SystemD modules on a non-NixOS?

Suppose I use nix-env to install a package that uses SystemD, on a Ubuntu host. What needs to be done to make Ubuntu's SystemD aware of the SystemD modules that come from Nix packages? Let's try ...
7
votes
1answer
1k views

Local Nix cache is ignored because NAR info file lacks a signature

[partially solved here: https://plus.google.com/110416349762686874861/posts/PVGHL1Tpeb9; but not entirely] I want to use one of my NixOS machines as a cache for the packages, to not pull everything ...
7
votes
2answers
1k views

Best method of copying full /nix/store over the network from one nixos machine to another

Currently I use: find /nix/store/* -maxdepth 1 | xargs -L <N> nix-copy-closure --sign --gzip --use-substitutes --to <remote machine> Where N is some reasonable number that will not make ...
7
votes
2answers
489 views

Quickly reload nix expression in nix-shell?

When I run nix-shell nix-shell ~/dev/nixpkgs -A pythonPackages.some-package and then edit phases of pythonPackages.some-package, how to reload nix-shell environment with new changes? Quit nix-...
6
votes
2answers
840 views

Cloning builder process: Operation not permitted when using Nix (under Linux) update channel

I use Arch Linux 4.19.15-1-lts #1 SMP Sun Jan 13 13:53:52 CET 2019 x86_64 GNU/Linux. I do also have Nix installed: nix-env (Nix) 2.2. I've never had any problems until the recent update to version 2....
6
votes
2answers
832 views

How to configure a Nix environment, outside of NixOS?

So far, I have been trying out the Nix package manager by nix-env -i installing packages. Now, I would like to manage that with a ~/configuration.nix, like the example here, so that I can version it ...
6
votes
1answer
1k views

name collision in input Nix expressions with nix-env -f

Following this previous answer that was given to me, I started following the nixpkgs-unstable channel with a git clone of this repository: https://github.com/NixOS/nixpkgs-channels/ My clone is in ~/...
6
votes
1answer
767 views

Run OpenGL application installed by Nix package manager

When I try to run application which uses OpenGL installed or built with Nix package manager, GLX errors shows up: $ /nix/store/p6fwy23nfcadxr4i780knajvmzga17aa-glxinfo-8.1.0/bin/glxinfo libGL error: ...
5
votes
1answer
2k views

Is there any way to remove single package from cache?

Is there any way to force removing a package from /nix/store/.. I am testing my expression for my package and want to make sure it will rebuild correctly. The problem is if I build my package once, ...
5
votes
2answers
940 views

nix package manager: perl warning: Setting locale failed

Whenever I run a command for the nix package manager (e.g. nix-channel --update) I get the following warning: perl: warning: Setting locale failed. perl: warning: Please check that your locale ...
5
votes
3answers
2k views

how to find which packages are installed system-wide in NixOS?

Is there a command that can be used to figure out which packages are installed system-wide in NixOS? For instance, I can list packages installed for my current user with nix-env -q. I don't know of ...
5
votes
3answers
2k views

Installing Nix or Guix without root permissions?

This answer to the question Non-Root Package Managers suggests Nix as a solution. However, the installation documentation says: The script will invoke sudo to create /nix if it doesn’t already ...
4
votes
1answer
661 views

How do I modify my hosts file in Nixos?

Seems my hosts file (/etc/hosts) points to /nix/store/gds7bha3bx0a22pnzw93pgf0666anpyr-etc-hosts and is read only. How am I meant to modify this file?
4
votes
1answer
1k views

How do I view information about a package in nix?

How do I get more details about a nix package, e.g. to verify that it actually is what I think it is. In Debian, I would use apt-cache show; but how do I get similar information for nix? A command to ...
3
votes
2answers
1k views

Nix desktop files

When I install a GUI application using nix, I see desktop files end inside ~/.nix-profile directory, e.g: ~/.nix-profile/share/applications/firefox.desktop However, my desktop expect that files to ...
3
votes
2answers
783 views

How to build 32-bit application on 64-bit system using Nix package manager?

It seems Nix should be able to install and build 32-bit packages on 64-bit systems. It's caches already store whole nixpkgs tree built for i686 architecture, and there should be no problem to download ...
3
votes
1answer
139 views

Can I manage my NixOS configuration in version control like git?

Long story short: I've used only distributions with "imperative configuration management/packaging" approach, so far. And,... I'm annoyed by hard to trace breakages/issues with imperative ...
3
votes
2answers
197 views

How can I set a custom DNS server within Nixos?

I've not found much information in the manual. I've tried to manually modify the file /etc/resolv.conf however this seems to be overwritten by something? How can I achieve this?
3
votes
2answers
217 views

How do I specify a path to an executable for a systemd unit file on nix?

I'm trying to write a systemd unit file. How do I specify the path to an executable? How can I determine what to use? In this specific case I'm trying to use mkdir. ExecStartPre = "/bin/mkdir -p %h/...
3
votes
1answer
619 views

Installing CMU fonts on NixOS

I have figured out that I need CMU fonts to be able to typeset Russian text with XeLaTeX. Under NixOS there is cm-unicode package for it, I have installed it with nix-env -iA nixos.cm_unicode but ...
3
votes
1answer
773 views

`ld: cannot find -lc` on NixOS

I have the following Nix derivation: with import <nixpkgs> {}; stdenv.mkDerivation rec { name = "scipoptsuite-${version}"; version = "4.0.0"; src = fetchurl { url = "http://scip.zib....
3
votes
1answer
459 views

How can I override a broken Haskell package in nix?

I use NixOS, and I'm trying to set up a Nix Haskell environment for my Haskell project. I have this Haskell package written in Nix that I'm trying to get working via nix-shell, but the dependent ...
3
votes
0answers
29 views

NixOS configuration to format disk before mounting

I'm running a VM on a virtual cluster. The (experimental) cluster provisioning system puts an unformatted block device in /dev/sdb. Upon cluster initialization, I want to format this device and mount. ...
3
votes
0answers
562 views

installing .net core sdk 2.0 on NixOs (can't find templates)

Resume I am currently trying to install dot-net-core-sdk 2.0 with the Nix package manager in NixOs. I am very new to both NixOs, Nix, bash scripting and stuff like ELF. Yet I think I've successfully ...
3
votes
0answers
167 views

How to use a package revision not yet in the published nixpkgs (but described in the development branches of nixpkgs)?

I'd like to use the new release of ghc (7.10, because of a new feature -- static ptr), and I'm using a single-user nix environment. I don't find the wanted new release in the published lists at https:...
2
votes
1answer
202 views

Dealing with NixOS missing dependency ~ libpng-dev

Moving away from an OS like Arch where packages are mostly available, how does one deal with a missing dev dependency like libpng-dev? I have an issue with a Node package dependency - pngquant-bin. ...
2
votes
1answer
747 views

nix: install virtualbox-guest

I am testing the nix package manager. I installed ubuntu in a virtualbox and try to install the guest additions. My ~/.nixpkgs/config.nix is { allowUnfree = true; packageOverrides = pkgs_: with ...
2
votes
1answer
145 views

Killing background processes started in nix-shell

I am developing a simple data science environment with Python tools and a database. When I enter the nix-shell, I spin up the database process. I would like to spin it down when exiting the ...
2
votes
1answer
105 views

NixOS: some user-subscribed channels are not shown by `nix-channel --list`, how to remove them (unsubscribe)?

I am confused by the current state of my channel subscription on NixOS. It seems that I have a per-user subscription to nixos-17.03 and nixos-17.09: $ nix-shell -p nix-info --run "nix-info -m" - ...
2
votes
1answer
161 views

Trouble merging two simple dot nix files for nix-shell

I am new to nix expression. I found two configuration files that I want to use in nix-shell. Unfortunately I failed to merge them due to my lack of nix expression knowledge. Always end-up with ...
2
votes
1answer
711 views

Disabling the security hardening options for a `nix-shell` environment

In an attempt to build GCC (6.3) on NixOS (16.09), within a nix-shell, I get this: make[1]: Entering directory '<my-build-path>/coreboot/util/crossgcc/build-i386-elf-GCC/build-x86_64-pc-linux-...
2
votes
1answer
309 views

manage packages of the system profile in NixOS

In NixOS how can I manage the system installed packages? If I run nix-env -q from root I get the packages installed by root (and available to all the users), but many are missing like ssh, the whole ...
2
votes
1answer
110 views

How to disable root password in NixOS?

I tried setting users.users.root.hashedPassword = "*"; similar to sudo passwd -d root or user { 'root': password => '*', require => Package[ruby-shadow], } in Puppet, but after sudo nixos-...
2
votes
0answers
322 views

“bash: cannot execute binary file” during nix dockerTools cross-build from MacOS host

A great 2016 blog post described building minimal Docker images with Nix. The below is a simple example taken from that blog post, modified to support Nix 2.0: { pkgs ? import <nixpkgs> {} }: ...
1
vote
4answers
489 views

How to install Python pip on Nixos?

I can't seem to find the appropriate package that install's pip on Nixos?
1
vote
1answer
241 views

Unable to install vim plugins

I am unable to install any vim plugins on nixOS running the command: nix-env -i vimplugin-Syntastic gives these as the last 3 lines of output: output path ‘/nix/store/...
1
vote
2answers
33 views

How can I reference the store path of a Nix package?

I'd like to add functionality relating to the awscli command completion. In my particular case I need to source the script from /nix/store/hvx7xqvjz7r08nsb9kssh1d9s302v3sp-awscli-1.16.106/share/zsh/...
1
vote
2answers
229 views

nixpkgs-unstable visible imperatively but not declaratively [closed]

I'm trying to install this Python library python3.6-geopandas-0.3.0. And I successfully installed it imperatively with $ nix-env -iA nixpkgs.python3Packages.geopandas However I need to create an ...
1
vote
1answer
354 views

View logs for nix-env last installation

I use NixOS: $ nixos-version 16.03pre71289.7ae05ed (Emu) $ nix-env --version nix-env (Nix) 1.10 $ nix-channel --list $ sudo nix-channel --list nixos https://nixos.org/channels/nixos-unstable ...
1
vote
1answer
25 views

Nix value is not of type `attribute set of signed integers'

I'm trying to set: networking.firewall.allowedTCPPortRanges = [ 80 81 5900]; However I get the below error: error: The option value networking.firewall.allowedTCPPortRanges.[definition 1-...
1
vote
1answer
786 views

How do I upgrade Nixos to use a new channel nixos version?

I'm currently on 18.03 and would like to upgrade to 18.09. How would I go about doing this? I've found the following via a web search but it's not very conclusive: https://discourse.nixos.org/t/how-...
1
vote
1answer
672 views

List packages I'm losing by running nix-env --delete-generations

I use NixOS, Nix version 1.10. nix-env, Nix package manager's installation command, creates a new generation every time you install a package. This way different package configurations are stored in ...