Questions tagged [nix]

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

Nix is a purely functional package manager for Linux and other UNIX-like operating systems. It aims to provide reliable and reproducible package management, featuring atomic upgrades and rollbacks, side-by-side installation of multiple versions of a package, multi-user package management and easy setup of build environments.

166 questions
29
votes
6 answers

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 configuration file: environment.systemPackages =…
Mirzhan Irkegulov
  • 8,248
  • 11
  • 45
  • 54
28
votes
2 answers

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 distributions? Currently I have to google the file…
Mirzhan Irkegulov
  • 8,248
  • 11
  • 45
  • 54
26
votes
1 answer

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 STUFF environment.systemPackages = with pkgs; […
Mirzhan Irkegulov
  • 8,248
  • 11
  • 45
  • 54
18
votes
3 answers

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 repository just containing my local add-on packages?
Michael Ekstrand
  • 2,064
  • 3
  • 21
  • 23
17
votes
2 answers

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?
Chris Stryczynski
  • 5,178
  • 5
  • 40
  • 80
16
votes
1 answer

How to remove single package from cache/nix store?

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, the next time I build it again it will use the…
wizzup
  • 585
  • 1
  • 5
  • 12
15
votes
1 answer

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-to-upgrade-from-18-03-to-18-09/933 I'm assuming I…
Chris Stryczynski
  • 5,178
  • 5
  • 40
  • 80
13
votes
4 answers

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 in my dotfiles. Is there a way to generate this…
Dan R
  • 133
  • 1
  • 4
13
votes
5 answers

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 finding the Nix installed .service files, and…
Dan Ross
  • 595
  • 2
  • 5
  • 14
13
votes
3 answers

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 be in /user/share/applications in order to be able…
cram1010
  • 397
  • 5
  • 13
13
votes
2 answers

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 library which is absent in the system. So, I've…
imz -- Ivan Zakharyaschev
  • 15,113
  • 15
  • 61
  • 123
12
votes
4 answers

How do I diagnose a failing nix-build?

How do I diagnose a nix-build failing? Currently I see output as: nix build -v warning: dumping very large path (> 256 MiB); this may run out of memory building '/nix/store/fdrm6kbm68vld3bhfjizv684ck725lyf-blog.drv'... builder for…
Chris Stryczynski
  • 5,178
  • 5
  • 40
  • 80
12
votes
4 answers

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 exist. If you don’t have sudo, you should manually…
Amelio Vazquez-Reina
  • 40,169
  • 77
  • 197
  • 294
11
votes
1 answer

How to package my software in nix or write my own package derivation for nixpkgs

How can I write a simple derivation to package a program for nix and how can I create a PR to include it in nixpkgs? (I am writing this as I can't find simple explanations)
tobiasBora
  • 3,376
  • 2
  • 23
  • 34
11
votes
1 answer

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 show the derivation for an arbitrary package…
jpaugh
  • 319
  • 2
  • 13
1
2 3
11 12