Questions tagged [nix]
Nix is a purely functional package manager.
811
questions
0
votes
0
answers
22
views
Differences between `nix-env --install --attr nixpkgs.hello`, `nix-env --install --attr hello` and `nix-env -f <nixpkgs> --install --attr hello`?
https://nixos.org/manual/nix/unstable/quick-start.html says
Install some packages from the channel:
nix-env --install --attr nixpkgs.hello
This should download pre-built packages; it should not ...
0
votes
1
answer
31
views
Why should this nix-env command without -b download pre-built packages? [closed]
https://nixos.org/manual/nix/unstable/quick-start.html says:
Install some packages from the channel:
nix-env --install --attr nixpkgs.hello
This should download pre-built packages; it should not ...
0
votes
0
answers
38
views
How to setup zsh/ohmyzsh in nixos?
my nixos config looks like this:
{ config, pkgs, ... }: {
programs.zsh = {
enable = true;
ohMyZsh = {
enable = true;
plugins = [ "git" "zsh-history-substring-...
-1
votes
0
answers
38
views
Does `<nixpkgs>` mean the Nixpkgs collection on a remote server, or something in the local machine? [duplicate]
In an Nix expression, does <nixpkgs> mean the Nixpkgs collection on a remote server, or something in the local machine?
For example,
nix-shell '<nixpkgs>' -A ...
0
votes
1
answer
30
views
How to ignore a missing file in the imports?
i have this in my nix config:
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
/home/dev/user.nix
];
When i do now nixos-install, it tells me that user....
1
vote
0
answers
27
views
How can I install a package into a nix shell from source for debugging using flakes, equivalent to python setup.py develop
Is there a way to include a package into a nix shell from source, ie the path linking not to a copy of the code in the nix store but to the actual source code, for debugging purposes?
I.e. I'm ...
0
votes
1
answer
24
views
Error when using lib.mkIf and lib.mkMerge to set configuration based on hostname
I am trying to set configuration based on hostname
config = lib.mkMerge [
( lib.mkIf config.networking.hostName == "nuc" {
config.installconfig.hardware.intel = true;
} )
( lib....
0
votes
1
answer
38
views
How should this table of platforms of dependencies be read?
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 ...
2
votes
1
answer
67
views
What are the "host and target platforms" of a dependency?
https://nixos.org/manual/nixpkgs/stable/#ssec-stdenv-dependencies-reference says:
Dependencies can be broken down along three axes: their host and
target platforms relative to the new derivation’s, ...
0
votes
0
answers
19
views
LunarVim not recognizing Haskell Language Server in Nix-environment
I have a nix working environment (created by my colleague - I have no nix skills myself) for programming in Haskell, and I am using LunarVim as the editor. It is set up on my desktop and my laptop.
...
1
vote
1
answer
54
views
What is propagation of a dependency?
https://nixos.org/manual/nixpkgs/stable/#ssec-stdenv-dependencies says
A dependency is said to be propagated when some of its other-transitive (non-immediate) downstream dependencies also need it as ...
1
vote
1
answer
71
views
How is fixed point used for overriding nixpkgs packages?
https://nixos.org/guides/nix-pills/nixpkgs-overriding-packages.html says
17.3. Fixed point
...
nix-repl> fix = f: let result = f result; in result
nix-repl> pkgs = self: { a = 3; b = 4; c = ...
1
vote
0
answers
38
views
List executable's nix runtime dependencies?
For an executable compiled in NixOS, is the following a good way to find runtime dependencies:
run ldd on the executable, which gives a list of store paths
run nix-store --query --references $...
-1
votes
0
answers
30
views
How to achieve "callPackage made our derivations overridable"?
14.3 in https://nixos.org/guides/nix-pills/override-design-pattern#id1431 says:
Now it would be nice if callPackage made our derivations overridable. That was the goal of this pill after all. This is ...
1
vote
0
answers
35
views
Are these two ways the same for overriding a function?
https://nixos.org/guides/nix-pills/override-design-pattern#id1431 provides a way of overriding a function f:
rec {
makeOverridable = f: origArgs:
let
origRes = f origArgs;
in
...
1
vote
2
answers
86
views
How to get the current nixos version (for example 23.05) in a nixos config?
Is there a method to retrieve the current NixOS version within a Nixos configuration.nix? I'm in the process of upgrading from NixOS 20.03 to 23.05 and I'd like to maintain a single configuration that ...
1
vote
1
answer
62
views
Why can't home-manager read environment variables using function builtins.getEnv?
Why can't home-manager read environment variables $USER and $HOME using Nix function builtins.getEnv in ~/.config/home-manager/home.nix?
# Excerpt from ~/.config/home-manager/home.nix
...
# Home ...
1
vote
1
answer
58
views
Can't find the package for XInput2.h header file on nixos
I have been trying to build some go projects that use X11 libraries and I have been getting an error like this when trying to build https://github.com/npmaile/PapeChanger/.
45 | #include <X11/...
-1
votes
1
answer
58
views
What does `with pkgs.lib; head [ 1 2 3]` mean?
In an old version of https://nixos.org/manual/nixos/stable/#sec-package-management, it said
with pkgs.lib; head [ 1 2 3]
Add all attributes from the given set to the scope (evaluates to 1 )
What ...
-2
votes
1
answer
85
views
Why not `{ let commonConfig = ...; in ...; }`?
https://nixos.org/manual/nixos/stable/#sec-module-abstractions says:
You can write a let wherever an expression is allowed. Thus, you
also could have written:
{
services.httpd.virtualHosts =
...
0
votes
2
answers
120
views
How to restart the shell inside the bash script and continue the execution of the script?
The initial problem: Install the nix package manager then install other programs (e. g. lua) using the nix by launching a bash script only once.
The solution: I have written the following bash script ...
0
votes
1
answer
52
views
How do i verify if a specific package has been installed in nixos?
I just added grim to my system packages in configuration.nix and ran sudo nixos-rebuild switch.
Now i want to verify it is installed on my system.
Normally i run something like grim --version for this....
-1
votes
2
answers
73
views
How to edit configuration.nix via text editor? [closed]
the only way i can edit configuration.nix is via the terminal.
The root user owns configuration.nix and my user does not have write access. Therefore, when i try to edit via a GUI like Kate i get a ...
0
votes
0
answers
105
views
Nix: How to configure NVChad in shell.nix
I am trying to use neovim with nvchad plugin. This is my shell.nix file so far:
{ pkgs ? import <nixpkgs> {} }:
let
nvchad = pkgs.fetchgit {
url = "https://github.com/NvChad/NvChad....
0
votes
2
answers
56
views
Problems with downloading and installing Nix on ubuntu
I've installed ubuntu and now I'd like to install NIX in order to later install ARTIQ enviroment. However once I'm following steps from manual https://nixos.org/manual/nix/stable/installation/...
1
vote
0
answers
124
views
Nix-darwin, home-manager, and flakes: how to set environment variables for the main user?
With nix-darwin, home-manager, using flakes, how to set environment variables for the main user ?
Here's a few approaches I've tried (copied from examples):
(this is a nix-darwin module)
{ pkgs, lib, ...
0
votes
0
answers
21
views
Package specific python source from private git repo in nixos
My repo contains many other python programs. I want to package a specific python program from my private git repo in Nixos.But am not able to fetch a specific program from below trying::
one more ...
0
votes
0
answers
32
views
How to set access permisions and create symlink in postInstall script block in Nix recipe
I am trying to install Grafana and Clickhouse plugin for it via modified recipe and nix-env commands on my Linux Mint machine. Almost all the recipes for Grafana and the Clickhouse plugin are original ...
2
votes
2
answers
100
views
How to Install a Private Package in NixOS
I compiled a package from my private git repository in NixOS. How can I install that package on a NixOS machine? I want to install my package and keep it private. Is there a command to install a ...
0
votes
1
answer
59
views
`shell.nix` to manually cross-compile a project for `mips-linux-gnu`
motivation
I have a set of steps to build a cross-compiled project (https://github.com/n64decomp/sm64). These steps require e.g. binutils targeting a MIPS platform like e.g. mips-linux-gnu. (Others ...
0
votes
0
answers
66
views
Railway Prisma Generate failing to install Prisma CLI in nixpack
I am stuck trying to deploy a FastAPI backend on railway because prisma fails to install its CLI during the build process. It was working just fine the last time I deployed it.
#12 [ 8/10] RUN prisma ...
2
votes
0
answers
80
views
home.shellAliases unable to set aliases using home-manager
I have set up home-manager like this inside my nix-darwin.
Every thing is working perfectly except for the shellAliases part.
# Home Manager configurations
imports = [ <home-manager/nix-darwin&...
0
votes
0
answers
80
views
How do I uninstall vscodium installed via nix-darwin?
I removed it from my darwin configuration file and rebuilt it.
It removes the codium binary from the path and removes the Application from the /Applications/Nix Apps folder.
But I know this isn't over ...
1
vote
0
answers
153
views
How to build a Node project using Nix and Flake?
I'm trying to build a web application using React and using Nix with Flake to build it, for that I am using this tutorial as an example, but I have this error:
error: builder for '/nix/store/my-app....
0
votes
0
answers
46
views
How to completely replace a Python module in nixpkgs using an overlay
I'm trying to replace a Python module (flask-limiter) by a completely different build script using callPackage in an overlay.
Based on the documentation for Python module overlays, I wrote the overlay ...
0
votes
0
answers
82
views
Deployment of Django project on Railway using Nixpacks
Has anyone know about step by step process how to deploy Django project on Railway using Nixpacks? I really mean easy to follow step by step guide follow up my first steps. I am using Windows 10:
...
0
votes
1
answer
85
views
Nix derivation error: unpacker produced multiple directories
I have following derivation to install jdtls files using nix flake.
{
stdenv,
fetchurl,
gnutar,
...
}: stdenv.mkDerivation {
pname = "jdtls";
version = "1.28.0";
src ...
0
votes
0
answers
30
views
How can I use the bbm latex package through nix?
I have made a small nix environment to make tex documents, but it does not work as expected. I am not knowledgeable enough in either nix or latex to pin down precisely what is causing the error.
An ...
1
vote
1
answer
28
views
`nix run .` works, but `nix run github:myorg/myrepo` doesn't
I have a flake.nix with an apps.default among its outputs. If I am in the project directory, the app runs when I run:
nix run .
But when I try to run it from a different machine:
nix run github:...
1
vote
0
answers
92
views
Nix flake only works within devShell: how to bind python package to writeScriptShellBin
So my school has a coding style, and thus a program checking it's compliance.
Recently they added libclang as a dependency of the python environment to their tool.
Only problem is, this env is managed ...
1
vote
1
answer
99
views
How to incorporate an arbitray nix flake into my flake dev shell with `mkShell`?
My rust dev shell flake.nix was:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = &...
0
votes
1
answer
40
views
Why does this Nix SQLite overlay lead to recompiling Python 3.10 packages?
I created a repository to demonstrate the problem. Clone it and run nix develop. This will try to enter the devShell which has sqlite as an input. That in turn is modified through an overlay that adds ...
0
votes
0
answers
113
views
How to cmake generate an Xcode project in a nix shell?
I am on macOS (x86_64-darwin) trying to generate an Xcode project with CMake in a nix shell and get the error below.
Generating the same project using the default generator (i.e. running cmake -B ...
0
votes
1
answer
514
views
How to properly install and configure PyCharm IDE in NixOS?
In NixOS, I have chosen to install pycharm-community via the NixOS configuration adding these lines to configuration.nix:
environment.systemPackages = [
pkgs.jetbrains.pycharm-community
];
...
1
vote
1
answer
135
views
How do I access the nixos (or nix-darwin) config from within a home-manager module?
How do I access the NixOS config from within a home-manager module, imported automatically by home-manager? When I use config, it's home-manager config, not NixOS config.
I have a home-manager module ...
1
vote
1
answer
152
views
How to create an ad-hoc NixOS package in configuration.nix
I'm trying to use a NixOS package that crashes upon starting. I checked the source, it appears to derive from the .deb release. The application's provider also offers an AppImage that I'd like to ...
0
votes
0
answers
101
views
clang linking error in nix derivation in macos
I am beginner to nix package manager and rust, getting an clang error while running nix command.
error: linking with `/nix/store/b9bh3z78rqff14bf0fd78xb07b5cnwdw-clang-wrapper-11.1.0/bin/cc` failed: ...
0
votes
1
answer
83
views
Populate NixOS VM wiith files
I work with NixOS VMs, I can add packages and services, but I struggle to add files (here some configuration and certificates, /etc, and a directory in a user).
I have tried the following:
{ config, ...
0
votes
1
answer
84
views
How to list the realisations of an impure derivation?
I'm using Nix 2.15.1. I have this impure derivation:
$ cat foo.nix
let pkgs = import <nixpkgs> {};
in
pkgs.stdenv.mkDerivation {
name = "impure";
__impure = true; # marks this ...
0
votes
1
answer
90
views
fetchPypi doesn't fetch the right url to load a .whl file to build a package
I ve followed these instructions (paragraph : build from source):
{
description = "virtual environment with python and streamlit";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-...