Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 2.01 KB

unstable.md

File metadata and controls

49 lines (31 loc) · 2.01 KB

To set up your Nix configuration to use the unstable version of nixpkgs, you can modify your ~/.config/nix/nix.conf file to include a specific channel or flake reference that points to the unstable version. Here are a couple of ways to do this:

Method 1: Using Nix Channels

If you are using Nix channels, you can add the unstable channel to your configuration. You can do this by running the following command in your terminal:

nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
nix-channel --update

This will add the unstable nixpkgs channel and update your channels.

Method 2: Using Flakes

If you are using flakes (which is an experimental feature), you can specify the unstable nixpkgs in your nix.conf or directly in your Nix expressions. To use flakes, ensure that you have the flakes feature enabled in your nix.conf:

  1. Open your ~/.config/nix/nix.conf file and ensure it includes the following line:

    extra-experimental-features = flakes
  2. When using flakes, you can reference the unstable nixpkgs directly in your Nix expressions. For example, you can use the following command to run a package from the unstable nixpkgs:

    ~/nixstatic run github:nixos/nixpkgs/nixos-unstable#hello

Example Configuration

Here’s how you might modify your ~/.config/nix/nix.conf file to include the necessary settings for using unstable nixpkgs:

# ~/.config/nix/nix.conf

store = ~/mynixroot
ssl-cert-file = /etc/pki/tls/cert.pem
extra-experimental-features = flakes nix-command

# Add any additional configuration options here

Summary

  • If you are using channels, add the unstable channel using nix-channel.
  • If you are using flakes, ensure the flakes feature is enabled and reference the unstable nixpkgs directly in your commands.

After making these changes, you should be able to access packages from the unstable version of nixpkgs. If you have any further questions or need additional assistance, feel free to ask!