Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

flake-parts integration? #131

Open
roberth opened this issue Apr 12, 2023 · 7 comments
Open

flake-parts integration? #131

roberth opened this issue Apr 12, 2023 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@roberth
Copy link

roberth commented Apr 12, 2023

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.

@bketelsen
Copy link
Member

I was looking for something exactly like this but didn't know what to search for!

@srid
Copy link

srid commented Apr 12, 2023

Not exactly as easy to use as fleek, but I use flake-parts to manage my home-manager among other things while still writing Nix: https://github.com/srid/nixos-flake => https://github.com/juspay/nix-dev-home - maybe you can borrow some ideas from there. I'd like to add support for Emacs, Neovim, etc. configured for dev envs: https://github.com/juspay/nix-dev-home/issues

@bketelsen
Copy link
Member

This is great context @srid thank you!

@bketelsen bketelsen added the help wanted Extra attention is needed label Apr 12, 2023
@bketelsen
Copy link
Member

@srid @roberth would you be interested in collaborating on this?

@srid
Copy link

srid commented Apr 13, 2023

@bketelsen I'm occupied with various projects right now, but I'd be happy to help re: questions / discussions / explanations and generally take part in design discussions.

@bketelsen
Copy link
Member

@srid @roberth I have a PR in now that does the integration with flake-parts (and nixos-flake). If either of you have time to take a look, I'd really appreciate it. I forked nixos-flake to add the hostname to the homeConfiguration's name because fleek supports multiple usernames and multiple hosts.

see #156

@bketelsen
Copy link
Member

a real-world generated flake with this PR is here: https://github.com/bketelsen/fleek

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants