Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to update nixpkgs #26

Open
yajo opened this issue Jan 7, 2022 · 3 comments
Open

A way to update nixpkgs #26

yajo opened this issue Jan 7, 2022 · 3 comments

Comments

@yajo
Copy link

yajo commented Jan 7, 2022

I have been struggling to update the bundled nixpkgs, as it is quite old these days. I can see that using nix-channel is not supported:

nix-portable/README.md

Lines 40 to 42 in 55feedf

### Missing Features:
- managing nix profiles via `nix-env`
- managing nix channels via `nix-channel`

Well... I just found a way to do it, and wanted to share it in case it helps adding that support.

# nix-portable comes like this:
~> nix-portable nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
"20.09pre-git"

# Let's try to update it:
~> nix-portable nix-channel --add https://nixos.org/channels/nixos-21.11 nixpkgs
~> nix-portable nix-channel --update
unpacking channels...

# It didn't work:
~> nix-portable nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
"20.09pre-git"

# Now, the magic:
~> ln -sf ../../.nix-defexpr/channels/nixpkgs ~/.nix-portable/channels/nixpkgs 
~> nix-portable nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
"21.11.335037.e67c94a1adb"

IIUC, by shipping that symlink out of the box, we'd get usable nix-channel!

@ZiWenWangCS
Copy link

Hi yajo, this didn't work for me, my is still "20.09pre-git". Also I think you meant ('~' instead of '../../'):
~> ln -sf ~/.nix-defexpr/channels/nixpkgs ~/.nix-portable/channels/nixpkgs

@DavHau
Copy link
Owner

DavHau commented Mar 10, 2023

It is updated on master. There is just no release yet as we still have a breakage inside docker environments. If you don't care about that feel free to just build a binary yourself from the flake on master

@a-zen
Copy link

a-zen commented Jun 25, 2023

@DavHau so newer versions won't work in docker anymore? :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants