fasterthanlime , Englisch
@fasterthanlime@hachyderm.io avatar

Nix friends!

How do I have:

  • flake.nix
  • subdir/flake.nix

And use subdir's flake from the top-level flake? path: used to accept relative paths but now complains with "cannot fetch input"

refi64 ,
@refi64@refi64.social avatar

@fasterthanlime
I actually use this in my home-manager setup!

But I have absolutely zero idea how I did it. Whenever I set it up on a new system I run some random flake update commands with some random protocols and at some point it starts working?

teivel ,
@teivel@mas.to avatar

@fasterthanlime I just do nix flake update relativeFlake if it complains about not being able to fetch it.

mazunki ,
@mazunki@fosstodon.org avatar

@fasterthanlime I'm not a nixer, but there seems to be an open draft concerning this: https://github.com/NixOS/nix/pull/10089

Kiskae ,
@Kiskae@hachyderm.io avatar

@fasterthanlime builtins.getFlake ./subdir?

jakehamilton ,
@jakehamilton@hachyderm.io avatar

@fasterthanlime that's the neat part, you don't!

No but really I just dealt with this in the aux labs repo. There actually isn't a way to refer to a flake in the same repository. Instead I had to import things manually...

https://github.com/auxolotl/labs/blob/f24f0876a9103c7adb8120ce9709fb90c73f2a7c/foundation/flake.nix#L14

fasterthanlime OP , (Bearbeitet )
@fasterthanlime@hachyderm.io avatar

@jakehamilton OH WELL. I'll just have to learn "the old ways". I tried to read the linked file several times and still cannot exactly tell what's going on, but maybe more coffee will fix this.

edit: https://jade.fyi/blog/flakes-arent-real/ is great btw

  • Alle
  • Abonniert
  • Moderiert
  • Favoriten
  • random
  • haupteingang
  • Alle Magazine