!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

903 Members
185 Servers

Load older messages


SenderMessageTime
1 Oct 2021
@edrex:matrix.orgedrex any other package, i would nix profile remove N and reinstall 18:15:51
@edrex:matrix.orgedrex(this is single user mode18:16:15
@roosemberth:orbstheorem.chRoos
In reply to @edrex:matrix.org
I should ask, "how can I update the system nix to a different branch of nixpkgs"?
If using flakes, you can add --override-input nixpkgs github:NixOS/nixpkgs/foo, where foo is the target branch (or commit). If not using flakes, you can probably just export NIX_PATH="nixpkgs=/nix/var/nix/profiles/per-user/myuser/channels/mychannel:$NIX_PATH" before running your nix command.
18:21:16
@edrex:matrix.orgedrex
In reply to @jez:petrichor.me
nix shell might be a better option for that?
nix shell nixpkgs/nixpkgs-unstable#nixUnstable gives
which nix => /home/eric/.nix-profile/bin/nix, which isn't what I expect (the version in my profile isn't from nixpkgs-unstable)
18:27:36
@edrex:matrix.orgedrex
In reply to @roosemberth:orbstheorem.ch
If using flakes, you can add --override-input nixpkgs github:NixOS/nixpkgs/foo, where foo is the target branch (or commit). If not using flakes, you can probably just export NIX_PATH="nixpkgs=/nix/var/nix/profiles/per-user/myuser/channels/mychannel:$NIX_PATH" before running your nix command.
Roos: i'm not using a flake for this rn. i have home-manager set up with my nixos hosts but not on laptop yet. To override NIX_PATH in that way, i guess I would have to create another channel with the branch set to nixpkgs-unstable?
18:31:49
@roosemberth:orbstheorem.chRoosYes.18:32:07
@roosemberth:orbstheorem.chRoos
In reply to @edrex:matrix.org
nix shell nixpkgs/nixpkgs-unstable#nixUnstable gives
which nix => /home/eric/.nix-profile/bin/nix, which isn't what I expect (the version in my profile isn't from nixpkgs-unstable)
Where is the nixpkgs/nixpkgs-unstable flake coming from? (You can use nix registry list to list the ones nix can see)
18:33:01
@roosemberth:orbstheorem.chRoos Unless nixpkgs/foo is some syntax I do not know. 18:33:11
@edrex:matrix.orgedrexfor context, I'm trying to install a nix with the workaround for https://github.com/nix-community/nix-direnv/issues/113 so I can do something other than mess around with nix :D18:33:16
@edrex:matrix.orgedrex
In reply to @roosemberth:orbstheorem.ch
Unless nixpkgs/foo is some syntax I do not know.
i mean, the flake output specifier can have the form nixpkgs/release-20.09#hello
18:36:35
@roosemberth:orbstheorem.chRoosTIL :D18:37:44
@edrex:matrix.orgedrex
In reply to @roosemberth:orbstheorem.ch
If using flakes, you can add --override-input nixpkgs github:NixOS/nixpkgs/foo, where foo is the target branch (or commit). If not using flakes, you can probably just export NIX_PATH="nixpkgs=/nix/var/nix/profiles/per-user/myuser/channels/mychannel:$NIX_PATH" before running your nix command.
*

Roos: i'm not using a flake for this rn. i have home-manager set up with my nixos hosts but not on laptop yet. To override NIX_PATH in that way, i guess I would have to create another channel with the branch set to nixpkgs-unstable?

note: first sent a few minutes ago, matrix troubles

18:44:44
@bew:matrix.orgbew
In reply to @edrex:matrix.org
nix shell nixpkgs/nixpkgs-unstable#nixUnstable gives
which nix => /home/eric/.nix-profile/bin/nix, which isn't what I expect (the version in my profile isn't from nixpkgs-unstable)
I use realpath `which nix` to get the full path to the current nix, then remove its package and use the fullpath to the previous nix to install new nix version
19:54:16
2 Oct 2021
@ncfavier:matrix.orgnf changed their profile picture.00:16:52
@Las:matrix.orgLasThe issue with that is that GC might remove the Nix in that small available timeframe.10:14:17
@Las:matrix.orgLas * The issue with that is that GC might remove the Nix in that small timeframe.10:14:24
@Las:matrix.orgLasThe best solution is likely installing the new Nix with a higher priority, then uninstalling the old one.10:15:04
@bew:matrix.orgbew
In reply to @Las:matrix.org
The issue with that is that GC might remove the Nix in that small timeframe.
You have automatic gc running? You could always open a nix shell with a nix version, this way you always have one (which cannot be gc'ed)
12:06:29
@Las:matrix.orgLasThat is another solution. Lots of people have automatic GC running.12:07:06
@balsoft:balsoft.rubalsoft

I've found a weird issue with Nix not adding a flake source as a runtime dependency. In particular:

  environment.etc."nixpkgs".source = pkgs.path;

When pkgs comes from a nixpkgs flake produces a "broken" etc: it has nixpkgs symlink pointing to -source nix store path containing the nixpkgs flake, but this path is not a runtime dependency of etc derivation, e.g. doesn't show up nix-store -qR or nix why-depends. toString-ing the pkgs.path beforehand doesn't fix the issue (as expected, since it gets toString-ed down the line anyways). Doing

  environment.etc."nixpkgs".source = pkgs.copyPathToStore pkgs.path;

Fixes the problem, but it's just weird.

15:04:25
@tomberek:matrix.orgtomberekDoes it help to do string interpolation with pkgs.path as you use it? “${pkgs.path}” ?17:11:25
@balsoft:balsoft.rubalsoft
In reply to @tomberek:matrix.org
Does it help to do string interpolation with pkgs.path as you use it? “${pkgs.path}” ?
Isn't "${pkgs.path}" exactly the same as toString pkgs.path ?
17:11:47
@balsoft:balsoft.rubalsoftI can try it I guess...17:11:53
@balsoft:balsoft.rubalsoftAha, ok, it seems it is different...17:13:15
@balsoft:balsoft.rubalsoftInteresting17:13:16
@balsoft:balsoft.rubalsoft Yeah it works fine with "${pkgs.path}" 17:13:25
@tomberek:matrix.orgtomberek This comes up sometimes. Interpolation kicks in a “string with context” which gives the dependency tracking the info. 17:13:32
@balsoft:balsoft.rubalsoft Hm, I thought toString gave a string with context too... 17:13:46
@balsoft:balsoft.rubalsoft

But yeah,

nix-repl> :t toString pkgs.path
a string

nix-repl> :t "${pkgs.path}"
a string with context
17:14:10
@balsoft:balsoft.rubalsoftIt makes a lot more sense now17:14:18

Show newer messages


Back to Room ListRoom Version: 6