this post was submitted on 25 Jun 2023
5 points (100.0% liked)

NixOS

1170 readers
1 users here now

NixOS is a Linux distribution built on top of the Nix package manager. Its declarative configuration allows reliable system upgrades via several official channels of stability and size.

This community discusses NixOS, Nix, and everything related.

founded 2 years ago
MODERATORS
5
submitted 2 years ago* (last edited 2 years ago) by PortugalSpaceMoon to c/nixos
top 3 comments
sorted by: hot top controversial new old
[–] rutrum@lm.paradisus.day 1 points 2 years ago (1 children)

I see what the other is doing by definiting types/values as flakes. Im unsure what the input.x.follows means though. Im not seen follows before.

[–] PortugalSpaceMoon 2 points 2 years ago* (last edited 2 years ago)

Assume you have two flakes A and B, and A takes nixpkgs as an input. Thus, A defines something like inputs.nixpkgs.url = nixos-unstable;. Now, assume B depends on A, so B defines inputs.a.url = "where-to-find-A".

When you evaluate B, then you pull in A's dependencies as it is defined by A. So B now depends on nixos-unstable. However, maybe you don't want to depend on unstable. You could of course just override the input nixpkgs to a paricular version. Or you say "the nixpkgs dependeny of A is the same as the nixpkgs as defined by B". So you say, in B: inputs.a.nixpkgs.follows = "nixpkgs";.

So now, A's nixpks is the same as B's inputs.nixpkgs when you evaluate B and you didn't need to touch A.

[–] Cwilliams@beehaw.org 1 points 2 years ago

This is atrocious. I love it!