NixOS is a Nix-based Linux distribution. Thanks to Nix, 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.
Questions tagged [nixos]
314 questions
53
votes
1 answer
Different methods to run a non-nixos executable on Nixos
What are the different methods to run a non-nixos executable on NixOs? (For instance proprietary binaries.) I'd like to see also the manual methods.
tobiasBora
- 3,376
- 2
- 23
- 34
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
24
votes
3 answers
How to install npm packages in NixOS?
In NixOS, I installed the package yarn as usual by running $ nix-env -i yarn. Now I am attempting to run yarn via $ yarn start. But this leads me to the following error.
$ yarn start
yarn start v0.20.3
$ webpack-dev-server --env dev
sh:…
mherzl
- 1,409
- 2
- 18
- 31
21
votes
1 answer
How to change the default shell in NixOS?
At the moment I need to set the fish shell to be my default shell on NixOS and there is no official documentation on how to do that declaratively (not by running chsh) in NixOS.
Sridhar Ratnakumar
- 883
- 1
- 7
- 17
19
votes
1 answer
What are the main differences between GuixSD and NixOS?
Guix is based on Nix. I know that Guix uses Scheme and has only free software in repos.
What are the main differences between them?
PHPoenX
- 366
- 3
- 10
19
votes
3 answers
How to auto mount / permanently mount external devices on NixOS
I have a USB stick and an NTFS hard drive partition that I'd want to use in NixOS. On some other distribution, I'd mount it using ntfs-3g in /mnt. But on NixOS, the directory doesn't exist; I suppose NixOS has some other canonical way and/or place…
stefkin
- 328
- 1
- 2
- 9
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
2 answers
How to add a file to /etc in NixOS?
What is the NixOS-way to put a configuration file in /etc?
E.g. I want to drop /etc/nanorc. I found some forum entries talking about programming it into /etc/nixos/configuration.nix, but could not find any documentation about that...
Robert Siemer
- 1,885
- 1
- 23
- 29
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
2 answers
Cannot execute binary in NixOS - No such file or directory
I tried to install the current oracle jre on a VM running NixOS.
Now the following happens:
[michas@cc:~]$ tar xvzf jre-7u40-linux-x64.tar.gz |grep bin/java
jre1.7.0_40/bin/javaws
jre1.7.0_40/bin/java_vm
jre1.7.0_40/bin/java
[michas@cc:~]$ ls -l…
michas
- 21,190
- 4
- 63
- 93
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
15
votes
4 answers
In nixos, how to remap caps lock to control?
I followed the instructions at this email thread, and placed
services.xserver.xkbOptions = "grp:alt_space_toggle, ctrl:swapcaps";
in my /etc/nixos/configuration.nix file, but even after rebuilding with $ nixos-rebuild switch, and rebooting with…
mherzl
- 1,409
- 2
- 18
- 31