!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

899 Members
184 Servers

Load older messages


SenderMessageTime
13 Jun 2023
@jake:hillion.co.ukJake Hillion joined the room.13:04:00
@federicodschonborn:matrix.org@federicodschonborn:matrix.org changed their profile picture.20:55:34
14 Jun 2023
@elonsroadster:matrix.orgelonsroadsterI'm probably missing some obvious documentation on this, but are there any CLEAR explanations of the follows mechanism of nix flakes. My flake.lock files consistently seem to accumulate like 20 different versions of nixpkgs, and my hope would be that they would all be pointing at the same underlying nixpkgs. Is there a principled way to solve this issue?00:15:03
@a-kenji:matrix.orgkenji
In reply to @elonsroadster:matrix.org

I'm probably missing some obvious documentation on this, but are there any CLEAR explanations of the follows mechanism of nix flakes.

My flake.lock files consistently seem to accumulate like 20 different versions of nixpkgs, and my hope would be that they would all be pointing at the same underlying nixpkgs.

Is there a principled way to solve this issue?

Nix flake Info should show you which input relies on which inputs.
00:22:04
@elonsroadster:matrix.orgelonsroadster Thanks a-kenji super helpful. Okay looking at it now, the problem is pretty deep down there in a transitive dependency. Is the right way to do this to make the dependency explicit and then explicitly set all the follows? 00:24:12
@a-kenji:matrix.orgkenjiIf you have an input called nixpkgs and an input that is called rust-overlay that itself has an input called nixpkgs, then you can pass it in the following way: rust-overlay.inputs.nixpkgs.follows = "nixpkgs";00:24:30
@a-kenji:matrix.orgkenji
In reply to @elonsroadster:matrix.org
Thanks a-kenji super helpful. Okay looking at it now, the problem is pretty deep down there in a transitive dependency. Is the right way to do this to make the dependency explicit and then explicitly set all the follows?
You should be able to set implicit dependencies you got from the registry as follows I believe. But I personally always use them explicit.
00:26:27
@elonsroadster:matrix.orgelonsroadsterright, but i still have to be explicit all the way down with all of my flakes. just a pain because my tree is huge ❯ nix flake metadata | wc warning: Git tree '/home/imalison/dotfiles' is dirty 113 419 1347400:27:20
@a-kenji:matrix.orgkenjiYes, I believe that is correct. I think you can't point all nixpkgs that are in the tree automatically to a specific nixpkgs version, if that is what you are asking. 00:28:29
@elonsroadster:matrix.orgelonsroadsterit actually might not be too hard to write a function to flatten everything though. Clearly there is a function that nix flake metadata calls, and you could probably write something to automatically flatten things to the top level for you, as long as everything is going to work using the same version of everything as identified by the flake input name00:31:45
@a-kenji:matrix.orgkenji
In reply to @elonsroadster:matrix.org
it actually might not be too hard to write a function to flatten everything though. Clearly there is a function that nix flake metadata calls, and you could probably write something to automatically flatten things to the top level for you, as long as everything is going to work using the same version of everything as identified by the flake input name
I don't think you can write functions in the inputs, but you could probably write some external tool that does it.
00:37:21
@emilazy:matrix.orgemily did a convention ever develop for outputs for "library stuff that is per-system"? like a nixpkgs-based makeXPackage. obviously there's legacyPackages but that sucks. lib.${system}.makeXPackage? I think I've seen functions.${system}.makeXPackage? 04:35:10
@raphi:tapesoftware.netraphi changed their display name from raphi (element unread channel fix when) to raphi.07:03:24
@ronnypfannschmidt:matrix.org@ronnypfannschmidt:matrix.organyone aware of a way to ensure all outputs of a flake are cached/stored on a local build7substutute server?16:39:18
15 Jun 2023
@ulli:hrnz.liulli set a profile picture.22:20:27
18 Jun 2023
@winston:milli.ng@winston:milli.ngBaby stepped my way into flakes today for my NixOS system, let see what all the hubub is about 04:33:15
@emilazy:matrix.orgemily why does inputs.foo.inputs.bar.follows = "quux"; give error: cannot find flake 'flake:bar' in the flake registries 09:12:57
@emilazy:matrix.orgemilyRedacted or Malformed Event09:13:24
@emilazy:matrix.orgemily * why does inputs.foo.inputs.bar.inputs.quux.follows = "quux2"; give error: cannot find flake 'flake:bar' in the flake registries 09:13:37
@emilazy:matrix.orgemilylike,e is there no way to override a nested input without adding a top-level input for the intermediate?09:13:48
@emilazy:matrix.orgemily * like, is there no way to override a nested input without adding a top-level input for the intermediate?09:13:55
@jassu:kumma.juttu.asiaJassukoAlso, is there really no way to override all nixpkgs instances of child flakes? If using more than few flakes it seems to grow into a horror show of a pile of different nixpkgs versions required for using the parent flake. 11:21:09
@madonius:entropia.de/madonius[er|he] changed their display name from /madonius [er|him] to madonius [PL].12:00:01
@tzycce:matrix.orgtzycce joined the room.12:52:16
@kranzes:matrix.orgIlan Joselevich (Kranzes)
In reply to @winston:milli.ng
Baby stepped my way into flakes today for my NixOS system, let see what all the hubub is about
https://ayats.org/blog/channels-to-flakes
12:57:49
@kranzes:matrix.orgIlan Joselevich (Kranzes)

Resources for undertanding flakes:

  • https://www.tweag.io/blog/2020-05-25-flakes
  • https://www.tweag.io/blog/2020-06-25-eval-cache
  • https://www.tweag.io/blog/2020-07-31-nixos-flakes
  • https://youtu.be/UeBX7Ide5a0
  • https://nixos.wiki/wiki/Flakes
12:58:35
@madonius:entropia.de/madonius[er|he] changed their display name from madonius [PL] to /madonius[er|he].15:33:36
@emilazy:matrix.orgemily
In reply to @jassu:kumma.juttu.asia
Also, is there really no way to override all nixpkgs instances of child flakes? If using more than few flakes it seems to grow into a horror show of a pile of different nixpkgs versions required for using the parent flake.
I assume doing inputs.X.inputs.nixpkgs.follows = "nixpkgs"; manually doesn't satisfy (hence "all")?
20:48:45
@emilazy:matrix.orgemilyoh, that was in reply to my own follows question so I guess no :)20:48:54
@winston:milli.ng@winston:milli.ng
In reply to @kranzes:matrix.org
https://ayats.org/blog/channels-to-flakes

Thank you.

I am still in a rough in-between state, but its working right now. https://github.com/wrmilling/nixos-configuration

22:36:30

Show newer messages


Back to Room ListRoom Version: 6