Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Marc
@corpsmoderne@mamot.fr  路  activity timestamp 2 weeks ago

I have an (yet another) understanding issue with #nix X) , I think I've a functional (sic) understanding of what a flake.nix is (or at least, does / provides), but on the other hand I've no idea what "regular" nix files are used for / how they are different. I have the feeling that I can split my flake.nix file into several nix files + small flake.nix "importing" them (how?), and I'm also under the impression this is not their only use, nor their main one 馃槉 . If someone has pointers for me <3

  • Copy link
  • Flag this post
  • Block
Steven Reed
@srtcd424@mas.to replied  路  activity timestamp 2 weeks ago

@corpsmoderne
I'm not exactly an expert either, so take with a pinch of salt, but: regular nix files are just nix expressions that can you import/evaluate (a bit like a C file you can #include) - the flakes stuff is a relatively new additional layer basically built on top. It allows you to define dependencies on other flakes, and pin their versions in a lock file like npm or go do.

  • Copy link
  • Flag this comment
  • Block
Steven Reed
@srtcd424@mas.to replied  路  activity timestamp 2 weeks ago

@corpsmoderne
Splitting files you can do two ways. The simplest is just to move an expression into another file and import it with 'import' 馃槉 More complicated is to make a proper 'module' like nixos and home manager do, which basically declares some options with explicitly declared types and docs (a schema I guess) and produces some config which is merged in with that from other modules.

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About 路 Code of conduct 路 Privacy 路 Users 路 Instances
Bonfire social 路 1.0.0-rc.3.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login