Questions tagged [nix]

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

Filter by
Sorted by
Tagged with
28
votes
4answers
14k 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 ...
1
vote
1answer
41 views

How to invoke `nix-shell` with the contents of an URL (e.g., a raw GitHub link)?

Saving it to file, and using that temporary file works fine, $ url="https://raw.githubusercontent.com/toraritte/shell.nixes/main/deno-latest-shell.nix" $ curl $url > default.nix $ nix-...
0
votes
2answers
25 views

How do I determine which commit a channel references with Nixos?

I'd like to figure out the commit and date that a channel references. For example how can determine that for the nixos2009 channel below? sudo nix-channel --list nixos https://nixos.org/channels/nixos-...
2
votes
1answer
1k 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
1answer
179 views

How to rollback a channel to a previous Nixos generation?

$ sudo nix-env --list-generations --profile /nix/var/nix/profiles/system ... 600 2020-01-25 21:01:11 601 2020-02-03 13:44:19 602 2020-02-09 14:06:20 603 2020-02-09 14:11:11 ...
0
votes
1answer
28 views

Unable to use -lfl on NixOS

I'm new to NixOS and I'm trying to build a project which uses Flex. I get the following error if I try and build the project /nix/store/b10shv9yqbgps47y0n8x7l7bq8fmp1i6-binutils-2.31.1/bin/ld: cannot ...
1
vote
1answer
50 views

Execute bash inside subshells

Say I have a command that puts me into a subshell (e.g. nix-shell). If I have a bash script that goes enter-subshell echo hi the echo hi will wait to be executed until I exit the subshell. Is there ...
0
votes
1answer
87 views

Wireguard client does not complete handshake on nixos

Mar 07 12:10:16 nixos kernel: wireguard: wg0: Handshake for peer 1 (192.248.152.91:58338) did not complete after 5 seconds, retrying (try 3) Mar 07 12:10:16 nixos kernel: wireguard: wg0: Sending ...
1
vote
1answer
144 views

How to force Nix to “install packages” by building them locally instead of downloading a pre-built binary?

By "install packages" I mean to evaluate Nix build expressions (using nix-env, nix-shell -p, etc.) to build from source instead of using a substitute. Originally posted on Stackoverflow but [...
1
vote
1answer
61 views

What is Nix equivalent of “guix challenge”?

In Guix user can verify reproducibility of a package with guix challenge https://guix.gnu.org/manual/en/html_node/Invoking-guix-challenge.html. What is the Nix command for that?
0
votes
1answer
65 views

NixOs Attribute Error with unstable package on stable release

I’m trying to install material shell which is only in unstable right now. I’m using the guide from the wiki to install a package from unstable along with this post on adding unstable without using a ...
0
votes
1answer
30 views

List all gc-roots that reference Nix package

I'm trying to remove package X entirely from my /nix/store/, but nix-garbage-collect wont remove it as its probably referenced by some garbage collection root (gc-root) somewhere. Is it possible to ...
1
vote
1answer
46 views

How to use specific verion of nixpkgs (on macOS)?

How can I point my nix installation (on macOS) to a specific version of nixpkgs? I'm trying to ensure that my home and office computers always use the same versions of all packages.
1
vote
0answers
17 views

Nix — how to use addAutoPatchelfSearchPath correctly?

I'm packaging a tool that includes some shared objects natively, and I think the right approach to add those objects to the rpath is to use the addAutoPatchelfSearchPath function to the installPhase ...
4
votes
1answer
283 views

Debugging why nix is building a package unnecessarily when it should be in nixpkgs binary cache?

I asked this question in the IRC channel, but thought I'd document it here for my own as well as other's reference. I have a shell.nix file that is taking a long time to build, in particular it seems ...
0
votes
0answers
28 views

How to register nix package after building?

I know that a nix package from repository can be installed via: nix-env -i package-name After that command executable file is on the path and it everything fine. On project page I spot that a nix ...
0
votes
0answers
58 views

Compiling termonad's config.hs on NixOS

I'm trying to use xmonad along with termonad on NixOS being a newbie in all of those. xmonad gave me a headache at first because installing it and ghc/stack was not enough to compile the xmonad.hs ...
4
votes
2answers
2k views

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/...
1
vote
1answer
452 views

Grow a Nix-based system from scratch?

Is it possible to grow a Nix (the package manager, not nixos the distro) based linux system from scratch? More specifically: AFAIK Nix provides infrastructural packages like glibc, gcc, linux kernel, ...
1
vote
0answers
417 views

Help debugging sshfs error: “fusermount3: mount failed: Operation not permitted”

I have spent a considerable amount of time trying to debug where the issue lies but am unable to find a fix. I am working on a 32bit CentOS system and have installed sshfs and fuse via nix. When I ...
0
votes
0answers
299 views

Building docker image with Nix dockerTools.buildImage - no internet access in build script?

I'm trying to build a simple docker image as mentioned here http://lethalman.blogspot.com/2016/04/cheap-docker-images-with-nix_15.html, but it seems there is no network/internet access in the build ...
0
votes
1answer
79 views

Nix config to configure qemu vm to mount direct partition

I'd like to do what is mentioned here: https://wiki.archlinux.org/index.php/QEMU#Mounting_a_partition_of_the_guest_on_the_host - essentially mount a partition directly on the VM - this is so I can use ...
3
votes
2answers
1k views

How can I discover and install a specific version of a package?

I have an installation of nix on a Linux system, and I have added the channel nixpkgs-unstable. I can now install packages such as gcc: % nix-env --install gcc installing 'gcc-7.4.0' ... created 78 ...
0
votes
0answers
370 views

Nixos how to configure pulseaudio config?

I'm trying to enable 5.1 audio output. My understanding is I need to add default-sample-channels = 6 to the pulseaudio config. I've tried: hardware.pulseaudio.configFile = pkgs.runCommand "default....
0
votes
0answers
27 views

How to add a file to global configuration in nixOS?

WPSOffice doesn't contain spellcheck for my native language and I need to create a directory with the dictionary inside /opt and the /nix/store route is readonly. If it's not possible, exists any ...
4
votes
1answer
311 views

How can I determine the package version that is cached in Hydra for Nix nixpkgs?

I was trying to build an old Haskell project with an older nixpkgs channel/branch (18.03). On my first attempt of building it, I specified the compiler version as ghc843... However when building - it ...
3
votes
1answer
896 views

How to add home-manager to my configuration.nix?

I want to add the home-manager channel to my configuration.nix, then install home-manager I don't have experience with NixOS. A simple code snippet is much appreciated, if possible.
1
vote
1answer
478 views

How to use Firefox Policies in NixOs / How to add config files to a Nix package?

I need to deploy my Firefox configured and with extensions in NixOS. I want to do that declaratively (in configuration.nix) and I do not want to use home-manager. Via user profile: Configuring ...
2
votes
2answers
1k 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 ...
0
votes
1answer
72 views

Nixos where is the path to my generation / system configuration derivation?

I'd like to get the root path to the generation / system configuration derivation. Is this path stored somewhere perhaps? My understanding is that there is a 'derivation' made for your system ...
1
vote
0answers
14 views

Why does `nix-store -q --tree` show autodependencies?

I'm trying to better understand nix, so I'm working through this nix pill. nix-store -q --tree does show dependencies as a tree, but for each dependency A it always says A depends on A: ➤ nix-store -...
3
votes
1answer
180 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. ...
0
votes
0answers
175 views

Nixos VM no IPv4 address assigned via dhcpcd

I'm using a vm setup with the following options: qemu.networkingOptions = [ "-device e1000,netdev=abc,mac=52:55:00:d1:55:02" "-netdev ...
0
votes
2answers
545 views

Setup network between VMs using tap network with Nix?

I'm trying to have a network shared between multiple VMs. I've tried adding: qemu.networkingOptions = [ "-nic user,model=virtio-net-pci" ...
0
votes
0answers
54 views

Where to put mutable data (logging, data)

New Nix user here. I'm trying to create a derivation for Blazegraph from the tgz release available here. Inside it are multiple folders such as bin/, conf/, data/, lib/, log/, pid/ and war/. The ...
2
votes
0answers
95 views

How can I ignore binary caches when running nix-channel commands?

Quite often, I'm away from home where I have a binary cache set for 192.168.0.6 and I run into errors like so: sudo nix-channel --update unpacking channels... warning: unable to download 'http://192....
1
vote
1answer
97 views

How can I list all nix store paths referenced in a build generation?

I'm trying to debug an issue where a nixos configuration on one machine, has the an application accessible in the path (it's listed in /run/current-system/sw/bin), while on another machine with the ...
2
votes
1answer
1k views

How to clone a private git repository in a nix derivation

{ nixpkgs ? import <nixpkgs> {} }:nixpkgs.pkgs.fetchgitPrivate { url = "ssh://git@gitlab.com/trycatchchris/blog.git"; rev = "0f5fe7ebf0724eb17aea4141e0cf3f1758a6d716"; ...
0
votes
1answer
102 views

Empty string syntax inside vimrc defined via nix home-manager

I want to use home-manager to declare my vim configuration inside a nix-expression with the extraConfig option. I'm trying to run the example .vimrc configuration from coc.nvim and one line reads: ...
14
votes
1answer
7k views

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, ...
0
votes
1answer
80 views

Nixos configuration use pinned nixpkgs for specific package

So my nixos-rebuild fails to build due to the recent error of: https://github.com/NixOS/nixpkgs/issues/74916 I thought I'd give a go at trying to fix this, by referencing a previous commit's package ...
10
votes
3answers
2k 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 ...
1
vote
1answer
207 views

In Nix, how can I build a package that has a Python post-install script?

I'm trying to make a Nix derivation for Foliate, and this is my first real derivation, so I don't really know what I'm doing yet. Here's what I have so far. It builds and installs, but fails with ...
0
votes
1answer
67 views

Setting up Kubespray python project on Nixos

nix-shell -p libffi openssl python37Packages.virtualenv python37Packages.virtualenvwrapper python37Packages.pip python37Packages.setuptools ... Collecting certifi>=2017.4.17 (from requests>=2.21....
1
vote
1answer
83 views

How to refer to another user's properties in Nix expression?

I want to set root's startGid and startUid to the GID and UID of another user. How can I do that without hardcoding them? I've tried several variations on the following: users.users = { root = {...
4
votes
1answer
4k 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-...
3
votes
1answer
300 views

Nixos how can I search for packages in a specific channel?

nix-env -v -qaP '*' currently returns all the packages available from all my channels. How can I specify to return packages from a specific channel for example unstable / 18.03?
2
votes
1answer
443 views

How to enable internet access for nixos container with private network

In my host I have: networking.nat.enable = true; networking.nat.internalInterfaces = ["ve-+"]; networking.nat.externalInterface = "wlp2s0f0u8"; In my container I have defined: ...
0
votes
1answer
480 views

How to disable binary cache for nix-env?

I was trying to figure out nix-serve / nix binary caching. At some point I added: nix = { binaryCaches = [ "https://cache.nixos.org/" "http://127.0.0.1:8899" ]; ...
1
vote
1answer
101 views

Nixos ssh with ZSH - command not found

I've got a fresh nixos VM. I have a minor issue where the PATH does not seem to be set when running commands via ssh. For example: ssh chris@192.168.0.10 'whoami' - Outputs: with zsh:1: command not ...