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/

378 questions
56
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,043
  • 1
  • 7
  • 16
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,654
  • 1
  • 17
  • 36
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
  • 9,544
  • 3
  • 40
  • 54
22
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
  • 26,641
  • 22
  • 94
  • 145
20
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
  • 784
  • 8
  • 16
19
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,148
  • 16
  • 37
19
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,027
  • 3
  • 39
  • 74
17
votes
1 answer

When does a nix path type make it into the nix store 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
  • 22,055
  • 11
  • 64
  • 113
15
votes
2 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
  • 18,516
  • 11
  • 84
  • 147
14
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
  • 3,733
  • 4
  • 25
  • 38
14
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,148
  • 16
  • 37
11
votes
5 answers

stack build error: attribute ‘ghc822’ missing, at (string):1:53

I am attempting to build my haskell project on NixOS. Running $ stack build gives the following error. $ stack build error: attribute ‘ghc822’ missing, at (string):1:53 (use ‘--show-trace’ to show detailed location information) What does this error…
mherzl
  • 4,119
  • 3
  • 25
  • 51
11
votes
1 answer

An Overview of Nix/OS Architecture?

While the Nix/OS wiki and manuals provide a lot of excellent information, I am still having trouble getting an architectural overview. Apologies for the quantity and naivity of the questions; feel free to answer a subset: 1. What constitutes a Nix…
Ixxie
  • 1,043
  • 1
  • 7
  • 16
10
votes
3 answers

Setting up Kubernetes on NixOS

On NixOS is is easy to set up Kubernetes by a single line of config: services.kubernetes.roles = ["master" "node"]; This installs both the master and node components on the local system and therefore creates a nice little working local kubernetes…
michas
  • 22,506
  • 9
  • 64
  • 105
9
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
  • 19,899
  • 28
  • 104
  • 198
1
2 3
25 26