Questions tagged [nix]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
12 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
40 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?
1
vote
1answer
67 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 [...
0
votes
1answer
56 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
19 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
0answers
16 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 ...
0
votes
0answers
25 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
54 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 ...
1
vote
1answer
375 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
371 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
222 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
71 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 ...
0
votes
0answers
314 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
22 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 ...
1
vote
1answer
43 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.
3
votes
1answer
754 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
444 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 ...
0
votes
1answer
63 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 -...
4
votes
1answer
258 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 ...
0
votes
0answers
151 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 ...
1
vote
1answer
154 views

How to get the channel commit for 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
2answers
484 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
46 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
92 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
91 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 ...
0
votes
1answer
99 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: ...
1
vote
1answer
972 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
73 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 ...
0
votes
1answer
187 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
62 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
78 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
262 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 ...
1
vote
1answer
271 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
394 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
434 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
92 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 ...
0
votes
1answer
45 views

client nixos error of “error: public key is not valid” when using nix-serve as binary cache

I'm running into an error of error: public key is not valid: [demo@nixos:~]$ nix-env -i ripgrep installing 'ripgrep-0.10.0' these paths will be fetched (0.00 MiB download, 4.76 MiB unpacked): /nix/...
1
vote
1answer
447 views

Nixos unable to modify or chmod nix config - '/etc/nix/nix.conf'

[root@nixos:/etc/nix]# sudo chmod 777 /etc/nix/nix.conf chmod: changing permissions of '/etc/nix/nix.conf': Read-only file system I remember this is some filesystem / Linux kernel utility to change ...
0
votes
1answer
254 views

Nix error: undefined variable 'goPackages'

I'm trying to build a docker image as described here: http://lethalman.blogspot.com/2016/04/cheap-docker-images-with-nix_15.html default.nix { pkgs ? import <nixpkgs> {} }: with pkgs; let ...
2
votes
2answers
785 views

How can I reference the store path of a Nix package?

I'd like to add functionality relating to the awscli command completion. In my particular case I need to source the script from /nix/store/hvx7xqvjz7r08nsb9kssh1d9s302v3sp-awscli-1.16.106/share/zsh/...
3
votes
1answer
164 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. ...
1
vote
0answers
62 views

How to detect redundant Nix packages?

Say I have services.foo.enable = true; and environment.systemPackages contains "foo". The latter is often redundant, because the foo service requires the "foo" package. How do I detect such duplicates,...
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-...
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
1answer
162 views

nix package manage: can't install firefox

Tried to install firefox, at first the dependent packages were installed correctly. But at the end I got the following errors: $nix-env -i firefox-67.0.1 ... post-installation fixup Moving /nix/store/...
0
votes
1answer
188 views

Is an executable portable between different Nixos hosts which reference different nixpkg commits?

I'm trying to get an executable to work by just copying it directly from one Nixos host to another. It works/executes on only one of the hosts. On old host (where it works): [root@...
1
vote
4answers
3k views

How to install Python pip on Nixos?

I can't seem to find the appropriate package that install's pip on Nixos?
5
votes
1answer
410 views

Can I manage my NixOS configuration in version control like git?

Long story short: I've used only distributions with "imperative configuration management/packaging" approach, so far. And,... I'm annoyed by hard to trace breakages/issues with imperative ...
3
votes
2answers
2k views

How can I set a custom DNS server within Nixos?

I've not found much information in the manual. I've tried to manually modify the file /etc/resolv.conf however this seems to be overwritten by something? How can I achieve this?