ublue-os / fleek

[deprecated] Own your $HOME
https://getfleek.dev
Apache License 2.0
835 stars 24 forks source link

flake-parts integration? #131

Open roberth opened 1 year ago

roberth commented 1 year ago

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:

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 commented 1 year ago

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

srid commented 1 year ago

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 commented 1 year ago

This is great context @srid thank you!

bketelsen commented 1 year ago

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

srid commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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