Questions tagged [nix]

Nix is a purely functional package manager.

Nix is a purely functional package manager. This means that it treats packages like values in purely functional programming languages such as Haskell — they are built by functions that don’t have side-effects, and they never change after they have been built.

Home page: http://nixos.org/nix

770 questions
7
votes
1 answer

Self and super in nix overlays

In nix, overlay is a function with 2 arguments: self and super. Based on the manual, self corresponds to the final package set (or some others call it result of the fix point calculation) and only to be used when dealing with dependencies. While…
autumn322
  • 447
  • 3
  • 10
7
votes
1 answer

How to install jbake from unstable with overlay in home-manager

After adding the unstable channel nix-channel --add https://nixos.org/channels/nixpkgs-unstable unstable I added an overlay under ~/.config/nixpkgs/overlays/package-upgrades/default.nix self: super: let unstable = import {}; in { …
John Mercier
  • 1,637
  • 3
  • 20
  • 44
7
votes
3 answers

pretty print of nix attrsets

when developing in nix i usually use builtins.trace for debugging: in code a = { foo = "bar"; ... more complex nested attrset ...}; builtins.trace a a; in nix-repl using :p a on a complex data structure is really hard to read also. the…
qknight
  • 866
  • 10
  • 23
7
votes
2 answers

How to undo `nix-channel --update`

After clean installation via NixOps, I logined to machine and executed # nix-channel --update This pulled ~130Mb of nixpkgs into my /nix/store. How can I undo this?
danbst
  • 3,363
  • 18
  • 38
7
votes
2 answers

nix: install derivation directly from master branch

I was wondering, why some packages appear in older versions than in the github repo when querying them via nix-env -qa .. . I learned that this is due to the fact that the master branch has not been merged to the unstable-channel. How would I…
Anton Harald
  • 5,772
  • 4
  • 27
  • 61
7
votes
1 answer

How to override 2 (two) packages in Nixos configuration.nix

I have some package to override in my configuration.nix. So I write the code as follows: nixpkgs.config = { allowUnfree = true; packageOverrides = { pkgs: rec { #mumble + pulse audio mumble = pkgs.mumble.override { …
Rizary
  • 123
  • 1
  • 7
7
votes
2 answers

How to gather the full config of a NixOS system?

I read a bit about NixOS and tried it these days, because I got the impression that it would let me configure a Linux with just one file. When I used it, I installed a bunch of packages with nix-env, so they didn't end up in the configuration.nix,…
K..
  • 4,044
  • 6
  • 40
  • 85
7
votes
1 answer

nix user packages vs system packages

I use Vagrant + virtualBox and a Debian 8 / Ubuntu image for my development environments. I want to use nix for provisioning, but I can't get nixOS to work completely right (ie. with networking, provisioning...), but I'd more than happy to switch.…
nha
  • 17,623
  • 13
  • 87
  • 133
6
votes
1 answer

nix rebuild switch cause "fchmod() of /tmp/.X11-unix failed: Read-only file system"

I have restart on WSL my installation from scratch: wsl --unregister Nixos wsl --import NixOS .\NixOS\ nixos-wsl-installer.tar.gz --version 2 wsl -s Nixos wsl nixos-wsl-installer.tar.gz comes…
6
votes
2 answers

How to globally override a pythonPackage in nix

I'm trying to override a python package (uvloop) globally, in nix, such that black sees the override. uvloop (python package) tests fail for me because I'm working behind a firewall. I can build things that use uvloop by editing the nixpkgs…
user3416536
  • 1,429
  • 9
  • 20
6
votes
3 answers

Is my M1 chip rejecting my Nix Build commands?

I was trying to run a Nix command to build a project: nix build -f default.nix plutus.haskell.packages.plutus-core.components.library and I received this error! error: attribute 'aarch64-darwin' missing, at…
6
votes
2 answers

find out what system type I am on in nix

I would like to write my nixos-configuration and home-manager-configuration files in a way that they work on both NixOs (linux) and MacOs (darwin). While some things are configured the same way on both systems (eg git) other only make sense on one…
Kaligule
  • 630
  • 3
  • 15
6
votes
1 answer

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. Also cross-posted to Unix& Linux because, as Charles Duffy pointed out, it is more on topic if it…
toraritte
  • 6,300
  • 3
  • 46
  • 67
6
votes
3 answers

How to find the commit a Nix channel points to?

When trying to revive old projects, sometimes I have to fish around for older Nixpkgs commits to get things started. For example, most of my shell.nix files start like this, {pkgs ? import {} }: pkgs.mkShell { # ... } that would import…
toraritte
  • 6,300
  • 3
  • 46
  • 67
6
votes
2 answers

Setting environment variables in nix via a shebang

Is it possible to set environment variables while using nix-shell which gets invoked via a shebang? For example, I'm using #! /usr/bin/env nix-shell #! nix-shell -i runghc --pure and would like to set an environment variable like FOO=bar. Note, FOO…
Max Maier
  • 985
  • 6
  • 16