fleek icon indicating copy to clipboard operation
fleek copied to clipboard

flake-parts integration?

Open roberth opened this issue 1 year ago • 7 comments

Hi!

This is a really cool project. I came across it on lobste.rs just now and realized that flake-parts would be a good fit for what you're doing, especially if you want to venture beyond nix and home-manager, and help out with custom packages, devshells, etc.

Is your feature request related to a problem? Please describe.

At some point, users will want to do something advanced and run fleek eject (which I think is a really neat idea).

What if instead, they could import their advanced thing into their fleek config, and keep using fleek?

Wouldn't it be nice to capture some more advanced patterns in Nix logic, and be able to share that with others?

Or perhaps reuse solutions to common problems that others have already solved?

Describe the solution you'd like

flake.parts provides the logic that lets you integrate these things. It takes pride in being an unopionated core, well, with two opinions:

  • the NixOS module system, which NixOS and home-manager are built on, is really nice
  • many things are a function of system, and standardizing the way to put that together is helpful

Because it's an unopinionated, thin wrapper around the schema of the Nix CLI, you can keep generating largely the same code you already are. You could put whatever flake outputs you generate right into the flake option.

A tighter integration - making use of the perSystem option - would be possible, but even without that, perSystem already works as expected for users if they write self'.packages instead of config.packages. Do you even generate packages? I might be overthinking.

Anyway, fleek eject could keep working the way it does, generating either a plain flake or a flake-parts based one, depending on user choice, or perhaps what's necessary if you decide to let some functionality rely on some flake-parts module.

Describe alternatives you've considered

Can't really think of any, but I can't claim to know the whole ecosystem either, and I'm really lazy when it comes to my home. It works :)

Additional context Add any other context or screenshots about the feature request here.

roberth avatar Apr 12 '23 17:04 roberth