Questions tagged [nixos]

NixOS is a Nix-based Linux distribution.

NixOS is a Linux distribution based on Nix, a functional programming language. It supports atomic upgrades, rollbacks and multi-user package management, and it has a declarative approach to system configuration management that makes it easy to reproduce a configuration on another machine.

Home page: https://nixos.org/

505 questions
85
votes
2 answers

When and how should default.nix, shell.nix and release.nix be used?

One of the first types of Nix expression one encounters when learning how to use the Nix package manager is default.nix; on the wonderful NixOS IRC channel I learned of the existence of shell.nix and release.nix as well. I got the impression that -…
Ixxie
  • 1,393
  • 1
  • 9
  • 17
31
votes
2 answers

How do I upgrade my system to nixos-unstable?

How do I make sure that all packages I install on my system nixos installation (i.e. packages listed in /etc/nixos/configuration.nix, which I install using sudo nixos-rebuild switch) are using the latest (unstable) version of nixos/nixpkgs?
sid-kap
  • 941
  • 1
  • 10
  • 17
31
votes
2 answers

Nix Composable Derivation Options

I'm trying to understand what options are available for me in my configuration.nix for particular programs, by searching the pkgs sub-folder of nixpkgs's source tree, picking out the module's definitions to understand the available options. However,…
Athan Clark
  • 3,886
  • 2
  • 21
  • 39
26
votes
1 answer

When does a Nix path type make it into the Nix store when converted to a string and when not?

I have noticed in the past that in nix, a ./myfile.txt path type seems to sometimes evaluate to /home/myuser/mydir/myfile.txt, and sometimes to /nix/store/55j24v9qwdarikv7kd3lc0pvxdr9r2y8-myfile.txt. I would like to understand exactly when which…
nh2
  • 24,526
  • 11
  • 79
  • 128
25
votes
1 answer

Build versus Runtime Dependencies in Nix

I am just starting to get to grips with Nix, so apologies if I missed the answer to my question in the docs. I want to use Nix to setup a secure production machine with the minimal set of libraries and executables. I don't want any compilers or…
Neil Bartlett
  • 23,743
  • 4
  • 44
  • 77
25
votes
1 answer

How do I use the new haskell-ng infrastructure on NixOS?

How do I setup a simple Haskell development environment on NixOS using the new haskell-ng infrastructure?
rzetterberg
  • 10,146
  • 4
  • 44
  • 54
23
votes
2 answers

What is the relationship between Disnix and NixOps?

One of the top-level projects on nixos.org is Disnix, "a distributed deployment extension for Nix". Another project is NixOps, "a tool for deploying NixOS machines in a network or cloud". The feature sets sound very similar. Are they competitors,…
jameshfisher
  • 34,029
  • 31
  • 121
  • 167
21
votes
1 answer

how to add NixOS unstable channel declaratively in configuration.nix

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…
illabout
  • 3,517
  • 1
  • 18
  • 39
18
votes
3 answers

NixOS: Setting the default channel in configuration.nix

How do I set the default channel in NixOS's /etc/configuration.nix? There is a command to set it and rebuild with sudo nix-channel --add https://nixos.org/channels/nixpkgs-unstable sudo nixos-rebuild switch -I…
Jacob Wang
  • 4,411
  • 5
  • 29
  • 43
17
votes
4 answers

nix-shell: how to specify a custom environment variable?

I'm learning about nixos and nix expressions. In a project folder I created a shell.nix and I when I run nix-shell I want it to preset an environment variable for me. For example to set the PGDATA env var. I know there are several ways to write nix…
monk
  • 640
  • 1
  • 5
  • 17
16
votes
1 answer

How can I combine two lists in Nix?

I've currently got a list defined as: environment.systemPackages = with pkgs; [ acpi ag alacritty audacity awscli bash breeze-gtk cabal-install ]; How would I go about defining two lists and then…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
16
votes
3 answers

What is the purpose of nix-instantiate? What is a store-derivation?

In the manual it is written : The command nix-instantiate generates store derivations from (high-level) Nix expressions. But what are store derivations ? The manual says the following about store derivations : A description of a build action.…
jhegedus
  • 20,244
  • 16
  • 99
  • 167
15
votes
1 answer

How can I nix-env install a derivation from a nix expression file?

I've got a default.nix file that builds a derivation (at least my understanding of it). { nixpkgs ? import {}, compiler ? "ghc864" } : nixpkgs.pkgs.haskell.packages.${compiler}.callCabal2nix "bhoogle" (./.) {} I can successfully nix-build…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
15
votes
3 answers

Using hoogle in a haskell development environment on nix

I'm trying to use hoogle in a Haskell development environment exactly like the one described by O'Charles' wiki: I have modified shell.nix like below in order to use hoogleLocal, but it doesn't seem to install the hoogle binary for me. let pkgs =…
illabout
  • 3,517
  • 1
  • 18
  • 39
14
votes
2 answers

Why doesn't `nix-env -q` find my installed packages? (NixOS channels, profiles and packages)

I recently installed NixOS and I ended up with 3 profiles: bruno (a user profile), default (used by root), and system (used by NixOS). I found it convenient to use a stable channel for the system profile and an unstable channel for me (bruno…
Bruno Bieth
  • 2,317
  • 20
  • 31
1
2 3
33 34