Questions tagged [nix]
Questions about Nix, the purely functional package manager and its usage and configuration.
182
questions
-6
votes
0
answers
61
views
What can Nix do on NixOS but not a non-NixOS Linux distribution?
https://nixos.org/manual/nix/stable/introduction.html says
NixOS
NixOS is a Linux distribution based on Nix. It uses Nix not just for
package management but also to manage the system configuration (e....
-1
votes
1
answer
54
views
Why is it not possible for one user to inject a Trojan horse into a package that might be used by another user?
https://nixos.org/manual/nix/stable/introduction.html says
Multi-user support
Nix has multi-user support. This means that non-privileged users can
securely install software. Each user can have a ...
-1
votes
0
answers
34
views
How are runtime dependencies found by scanning binaries for the hash parts of Nix store paths?
Complete dependencies
Nix helps you make sure that package dependency specifications are
complete. In general, when you’re making a package for a package
management system like RPM, you have to ...
-3
votes
1
answer
53
views
Does Nix solve the DLL hell problem differently from other more popular package managers for Debian or Arch?
https://nixos.org/manual/nix/stable/introduction.html says about Nix that
Multiple versions
You can have multiple versions or variants of a package installed at
the same time. This is especially ...
0
votes
0
answers
51
views
How shall I understand the synopsis of this command?
https://nixos.org/manual/nix/stable/command-ref/nix-shell.html
Synopsis
nix-shell [--arg name value] [--argstr name value] [{--attr | -A}
attrPath] [--command cmd] [--run cmd] [--exclude regexp] [--...
-2
votes
1
answer
70
views
How should this table of dependencies be read? [closed]
https://nixos.org/manual/nixpkgs/stable/#ssec-stdenv-dependencies-reference says
A dependency is said to be propagated when some of its
other-transitive (non-immediate) downstream dependencies also ...
-1
votes
2
answers
128
views
How shall I understand dependency propagated? [closed]
https://nixos.org/manual/nixpkgs/stable/#ssec-stdenv-dependencies-reference says
A dependency is said to be propagated when some of its other-transitive (non-immediate) downstream dependencies also ...
1
vote
1
answer
70
views
How to preprocess output of any CLI Tool in realtime?
For context, what I am trying to do is add a preprocessor to a REPL, more specifically, nix repl. Although this would probably apply to any other REPL like application.
The reason for it is that I ...
0
votes
1
answer
36
views
Does nix-build affect user environment?
nix-env for installation and uninstallation of a package doesn't change the current user environment, but creates a new one.
nix-build builds a derivation, which can also install a package. Does it ...
0
votes
1
answer
34
views
How to change appearance of nix-env packages installed on non nixOS?
I installed vscode using nix-env command, nix-env -iA nixpkgs.vscode. My system is dark. But, VS Code using light file portal and weird default cursor theme for Xorg. While it's not a big deal, but, I ...
0
votes
1
answer
59
views
NixOS <crypt.h> missing when installing a Perl module from CPAN
I'm fairly new to NixOS, but I'm trying to install App::cpm from CPAN.
I run the following:
cpan -i App::cpm
It chugs for a little bit then, it fails on Build::Tiny:
crypt.h: No such file or ...
0
votes
0
answers
59
views
why does running nixos-rebuild switch --upgrade gives symlink error after switching to unstable channel?
Nevermind, i fixed it, by manually running nix-channel update before running nixos-rebuild switch --upgrade
I am trying to upgrade from nix-23.05 to unstable but I'm getting some weird errors.
Heres ...
0
votes
0
answers
52
views
What relationship and difference are between `nix-env --install` and `nix-build`?
What relationship and difference are between nix-env --install and nix-build?
Does nix-env --install build the derivatives specified to it, i.e. perform the job of nix-build?
0
votes
1
answer
56
views
How to ensure that NixOS configuration will build or use the same package versions in the future?
In Software packaging and distribution for LHCb using Nix, the authors write:
In order to facilitate this use, software must be stable for long
periods; much longer than even Long Term Support ...
0
votes
1
answer
109
views
How to add documentation to Git package in NixOS?
git help some-alias prints the alias configuration value, for example:
$ git help aliases
'aliases' is aliased to '!git config --get-regexp '^alias\.' | cut --delimiter=. --fields 2-'
I'd like to ...
0
votes
1
answer
35
views
How to get a map of filename without extension to file contents from a directory path in configuration.nix?
Basically, I want to pull my config.programs.config.alias entries into separate .bash files and read them dynamically when building the configuration. A representative subset of the current ...
2
votes
0
answers
97
views
auto-patchelf could not satisfy dependency libQt5SerialPort.so.5
I am trying to run Qt Design Studio 2.3.1 Community on NixOS.
My nix derivation code:
flake.nix:
{
description = "Qt Design Studio";
inputs = {
nixpkgs.url = "github:NixOS/...
1
vote
1
answer
251
views
How to find values within Nix configuration
I recently started using NixOS version 23.05.885.bb8b5735d6f. I see some (predefined) expressions in the configuration, but I don't know what could be the actual value bound to these.
For instance, I ...
0
votes
0
answers
577
views
Building Nixos config where I merge two attribute sets with mkMerge results in error of "The option `imports' does not exist. Definition values..."
What I'm trying to do:
I'm trying to have a Nixos configuration defined, that can be
Installed (this would be the configuration-pineapple.nix file)
Installed/run as a VM, by setting some additional ...
-1
votes
1
answer
114
views
nix-shell default.nix: How to install rPackages.data_table with the zlib dependency?
I have a multi-user installation of nix on ubuntu 22.04. I'm trying to develop an R package that depends on data.table, but am unable to install data.table with zlib headers so that I can use the ...
0
votes
1
answer
318
views
How to set locale in Nix shell on Ubuntu?
To demonstrate locale support in Ubuntu:
vagrant init ubuntu/jammy64
vagrant up
vagrant ssh
sudo apt-get -y install hello language-pack-nb
LC_MESSAGES=nb_NO.UTF-8 hello
This prints the expected, ...
4
votes
2
answers
2k
views
How to pin a package version with `nix-shell`?
From what I understand, I can use a given version of Nix packages using the -I flag. But I would like to know if it is possible within a single shell.nix conf to have something like:
git v2.1.2
htop ...
0
votes
0
answers
117
views
Error with g++ when compiling opencv nix package
Here is my error when i try to install the opencv nix package:
/nix/store/3mn8a8v7l7kypl9bah0xwymyp6080kn9-opencv-4.5.4.drv
building '/nix/store/3mn8a8v7l7kypl9bah0xwymyp6080kn9-opencv-4.5.4.drv'...
...
0
votes
1
answer
127
views
how to change a var env value with nix
here is my default.nix:
with import <nixpkgs> {}; {
cimgEnv = stdenv.mkDerivation {
name = "cimgdev";
buildInputs = [ pkgconfig stdenv cimg xorg.libX11 boost jdk gradle (opencv4....
1
vote
1
answer
275
views
How to run `zsh-newuser-install` without modifying existing files
The top-level problem I want to solve is to run zsh-newuser-install configuration script. This is what's executed when zsh opens for the first time and sees no .zprofile/.zshrc/... files. I don't want ...
1
vote
1
answer
196
views
How to launch nix-shell with package with a long name
nix-env -iA nixpkgs.python311
it works
But when i do a
nix-shell -p nixpkgs.python311
or a
nix-shell -p python3-3.11.1
visibly there are problem in the name and arg
nix-shell -p python3-3.11.1 ...
0
votes
0
answers
326
views
.desktop files for packages installed using Nix are broken
I've recently installed Filezilla and Keepass using Nix on Kubuntu 22.10 and symlinked my ~/.nix-profile/share/applications to /usr/share/applications, so that the apps appear in the application menu.
...
0
votes
1
answer
127
views
Nix shell with customized dependencies
I now understand how to write a basic shell.nix
the a project that I am developing.
I have something like this:
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
...
0
votes
1
answer
123
views
How to create a list of system packages with their description?
I need to create a file with the list of all packages installed system-wide.
I can see in the repl that pname and meta are available for each package
nix-repl> emacs.pname
"emacs"
nix-...
0
votes
1
answer
228
views
How to synchronize files between a NixOS declarative container and local system path (equivalent of docker-compose volumes functionality)?
I have NixOS 22.11 set up on a local workstation.
I use extra-container package, which can run declarative NixOS containers like imperative containers, without system rebuilds.
I'm trying to run a ...
0
votes
0
answers
71
views
How do I make it so I don't need to log out and log back in for the apps I've installed with nix package manager to show up?
When I install a new app with the nix package manager on fedora (silverblue) I need to log out and log back in for the app icons to appear for the new apps I installed with nix. I made them show up by ...
1
vote
1
answer
379
views
How to install Nix "silently" without having to answer to prompts? (e.g., to install it from a shell script)
I have a script that needs to be run on brand new virtual machines, but it depends on Nix being present, and I don't want to manually install it every time.
1
vote
0
answers
104
views
yubikey-agent not running on login
According to man configuration.nix, enabling services.yubikey-agent should start yubikey-agent on login:
services.yubikey-agent.enable
Whether to start yubikey-agent when you log in. Also sets ...
0
votes
0
answers
222
views
Installing DWM on gentoo
I was just trying to install dwm on my gentoo machine but I keep on encountering the same problem every time I make clean install. The error is...
drw.c:5:10: fatal error: X11/Xlib.h: No such file or ...
1
vote
0
answers
221
views
Install of nix via nix-installers breaks system on Fedora 37
I tried to install the Nix package manager on my Fedora 37 machine. Having read about some issues with installing Nix with the install script on Fedora and other OS, using Selinux, I chose install via ...
0
votes
1
answer
225
views
SSH not possible when using fish (installed through Nix) as shell
Using the nix package manager, I've installed fish for my login shell. I've added the shell to /etc/shells:
$ bat /etc/shells | grep --color=auto fish
/home/ajgringo619/.nix-profile/bin/fish
This ...
0
votes
3
answers
2k
views
How to install and run docker with nix
I'm using Debian on WSL.
Nix is already install.
I install docker with this command:
nix-env -iA nixpkgs.docker
I want to start the daemon :
systemctl start docker
Failed to connect to bus: No such ...
3
votes
1
answer
820
views
Unable to run alacritty using nix
.nix-profile/bin/alacritty
Error: Error creating GL context; Received multiple errors:
Could not create EGL display object
`glXQueryExtensionsString` found no glX extensions
Error: &...
0
votes
0
answers
1k
views
Wine: 0024:err:process:exec_process L"" not supported on this system
I'm attempting to run Among Us.exe on my machine with Wine but I keep experiencing the same issue:
0024:err:process:exec_process L"Z:\\home\\runner\\Games\\AmongUs\\Among Us.exe" not ...
1
vote
1
answer
518
views
How to add a non-root user when building a Docker image with Nix
I can use Nix to specify a Docker image:
{ pkgs ? import <nixpkgs> { }
, pkgsLinux ? import <nixpkgs> { system = "x86_64-linux"; }
}:
pkgs.dockerTools.buildImage {
name = "...
2
votes
1
answer
2k
views
How to replace OpenSSL with LibreSSL globally?
In light of the upcoming critical OpenSSL 3.0.7 security fix, how do I change NixOS over to use LibreSSL globally instead of OpenSSL?
1
vote
1
answer
626
views
Conflicting Nix Home Manager packages
I've been using Nix Home Manager to manage packages on Mac OS, and hit a new problem adding ripgrep to home.packages - this has previously been fine. I don't really know what the error means or how to ...
1
vote
1
answer
306
views
How to fix error building a Docker image with Nix using a pinned revision
I'm trying to build a Docker image with Nix at a pinned revision. The file works when it looks like this:
{ pkgs ? import <nixpkgs> { }
}:
pkgs.dockerTools.buildImage {
...
But fails when it ...
0
votes
1
answer
349
views
How to override an imported predicate?
Consider a /etc/nixos/root.nix containing the following:
{
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"foo"
];
}
This configuration is ...
0
votes
2
answers
483
views
How to use packages directly in `allowUnfreePredicate`?
The manual suggests allowing packages by name:
{
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"roon-server"
"vscode"
];
}
Is it possible to instead do ...
4
votes
1
answer
1k
views
How to print all available attributes of a Nix expression
To figure out why a repo is failing to build I'd like to enumerate all the available attributes in the source. That is, list every ATTR which fits into nix-build --attr ATTR https://github.com/USER/...
4
votes
1
answer
679
views
How to include a specific list of files in `src`?
This derivation seems to include all files in the current directory, recursively, as expected:
src = builtins.path {
name = pname;
path = ./.;
};
I'd like to only include a small subset of that; ...
2
votes
1
answer
875
views
users.users.<name>.packages vs home-manager packages
Is there any practical difference between
users.users.default.packages = [
pkgs.foo
];
and
home-manager = {
users.default = {
config,
pkgs,
nixpkgs,
lib,
specialArgs,
...
1
vote
1
answer
380
views
How to specify `buildPythonPackage` wheel Python versions, ABI, and platform tags?
When using buildPythonPackage the resulting wheel ends up as $dist/${pname}-${version}-py2.py3-none-any.whl. py2.py3 are the Python versions, none is the ABI, and any is the platform. How do I specify ...
1
vote
1
answer
94
views
How to use the new `pythonOutputDistHook` in nixpkgs?
I've tried a bunch of things to get my project to create a result-dist folder with a wheel I can publish to PyPI. Somehow, even though I'm using a nixpkgs version with pythonOutputDistHook in it, I ...