Fleek - User friendly home-manager

I created fleek as a tool to provide a simpler interface to Home Manager so that people who don’t have Nix experience can get basic tools installed quickly.

I haven’t announced it anywhere yet, and I was hoping to recruit some knowledgeable nix/home-manager users to take a look and suggest any changes to the configs that are generated. I want new users to have a simple experience installing basic tools, adding directories to their $PATH, and get a very-lightly opinionated configuration for their shell.

You can read the documentation website if you want more details.

I’d really appreciate it if you took a few minutes and looked over the code or the generated flakes to see if I’m doing things soundly, or suggest any config changes that would make a user’s life easier.

I’m hoping tools like Fleek will make an easier on-ramp to using Nix.

Cheers!

25 Likes

Sorry, but nix is not an unfriendly language.

It’s a powerful language with pretty simple syntax which sometimes can become a mess to read and write, but replacing it for yaml does not help, but instead makes things usually worse as soon as you do something that is not directly representable in yaml.

In other words: it restricts what you can do by the nature of yaml.

At the same time, you will face the problems that you simply get by how nix works, and you have less ways to circumvent. Just how would you create a python.withPackages? As little as I like to see those in HM, this is an honest question.

Also, why do the instructions rely on imperatice instructions using brew or manually copying files into PATH? Why don’t you use nix to install fleek?

All in all, I don’t see much sense of all the $config2nix tools that aim to simplify nix or try to hide nix.

Sounds nice on the first read, though they simply introduce too many restrictions which makes everything more a hazzle than necessary.

Just teach people nix. That’ll be easier in the long run.

22 Likes

A main reason why many of us switched to Nix is because we were tired and sick of writing awful YAML. Why is Fleek bringing back YAML into the picture?

I find Nix to be a very friendly and easy to understand language for beginners, it’s just “JSON with some functions”. key = value. It only gets a bit complex if you start using stuff like lib or builtins. For using home-manager you don’t need to basically ever use lib or builtins, so does this YAML thing just saves us from adding a semicolon (; after every line?

I agree with what @NobbZ has said, teaching people actual Nix will be much easier than teaching them an overly abstracted, dumbed down wrapper around it.

12 Likes

I agree with the previous 2 comments. I see no value in this “YAML to Nix translation layer”. A potentially useful thing that Fleek could have done is serve as a “getting started” tool for home-manager, as in let the user interactively pick some basic preferences, then generate a nicely extensible home-manager config in a flake and hand that to the user for further editing. The “bling” thing could’ve easily been implemented as a home-manager module.

5 Likes

Fleek could have done is serve as a “getting started” tool for home-manager, as in let the user interactively pick some basic preferences, then generate a nicely extensible home-manager config in a flake and hand that to the user for further editing.

So like what https://mynixos.com already does?

5 Likes

For packages i maintain out of tree I use imperative tools to fetch information and serialize into json compatible with fetchFromGitHub and others and use let versionInfo = builtins.fromJSON (builtins.readFile ./version.json). It’s quite convenient to use JSON libraries to generate some things from other languages / scripts.

1 Like

This is what I understand as a valid usecase, JSON supporting nix, though would you want to replace all the nix with some static JSON/YAML/TOML?

2 Likes

@bketelsen I’m impressed by the presentation of https://getfleek.dev/ and the amount of work that has gone into the UX of this project. It shows that you care about the users.

I’m not happy with the dunking that is happening in this thread. It’s effectively shutting the conversation down. The author has put a lot of effort into this project so the minimum would be to be respectful.

44 Likes

Trust me, I appreciate any tries that make nix more approachable, though this is not.

This tries to hide nix behind YAML, and by briefly skimming the docs, I was unable to see a way to combine this with real nix, in case I have to do something thats not expressible in the YAML.

This even seems to generate a flake under the hood, but requires imperative steps for installation “outside” of nix, why not just nix run … -- init, and generating a config, that would just include a self-managed fleek from then on, similar to HM does it with programs.home-manager.enable = true?

OP asked for how they could improof fleek…

So I will rephrase my initial rant into this suggestions for improvements:

  1. Make use of flake-apps for the bootstrapping
  2. Do not use YAML as primary source or the only supported format, but allow for using actual nix!
    Without this being changed, fleek will not be able to gain much adoption. As there will be no way around its own limitations.
  3. Document how to translate HM options to fleek options
  4. Document how to use services (is that possible at all? Didn’t find them in the docs at all)
5 Likes

People here who have persevered through the pain of learning the language might have a slightly biased perspective, here.

Personally, it took me longer than otherwise necessary to become comfortable with nix as a whole because the language was not effortless to grasp.

8 Likes

Matching the Power of Nix with User Expectations and good Marketing is a missing link in the Nix Ecosystem Value Chain.

And,
— deep in our hearts — we’re probably all aware.

I very strongly commend this effort.

It is necessary.

6 Likes

I’ve been wanting to do this for a while, and thus made a start with nixos-flake and nix-dev-home. The “let the user interactively pick some basic preferences” part can be facilitated by enabling nix flake template to take in parameters: Feature request: Flake templates with variables · Issue #4017 · NixOS/nix · GitHub

I appreciate projects like fleek, and I like the motivation and idea behind them (enable use of the Nix ecosystem but using a friendly UX), but I’d also like to be able to write Nix itself. Surely there must be a way to use a subset of Nix to provide that friendly UX?

2 Likes

How would you recommend me the give my feedback without it being considered as “dunking” according to you?

OP has asked to get feedback from HM/Nix users and that’s exactly what I did. To me it seems as if every negative feedback will come out as “dunking” from your view.

1 Like

The pure data subset of Nix can be understood in 5 minutes if the reader has prior JSON/YAML knowledge. If we had better language support and tooling (similar to jq but for Nix), then it would be more likely for tool writers to use Nix instead of those serialization languages. This is also true inside of nixpkgs where we are tempted to use JSON over Nix due to that convenience factor.

9 Likes

I’d say that in the past year the Nix language situation has got infinitely better, we have a very good LSP (nil), we have a library functions search engine (noogle) and a pretty good general language tutorial on nix.dev (Nix language basics — nix.dev documentation).

I would understand complaining about the Nix language learning situation before these improvements came out this year, but that isn’t the case anymore.

5 Likes

This is because everyone confused the languages syntax and minimal builtin function set with all the applications and frameworks introduced through nixos-modules and nixpkgs.

At its heart, “nix” the expression language is not much more than “JSON with functions”.

For using basic HM and NixOS configuration, you can even treat it like that… And when it comes to the point where you can’t anymore, YAML won’t help you either.

5 Likes

Should we start a separate thread on how to provide constructive feedback? I don’t mean to distract this thread. Or DM me.

9 Likes

I think that’d be a good lesson for many people in the community (including myself). So yes, if you feel like it.

Another reason why my feedback wasn’t that constructive is because I have a big pet peeve in tech when people create new projects to solve a problem that has already been solved (in my opinion) or if I don’t think it’s even a problem in the first place.

My feedback basically boiled down to this:

  1. Why use YAML when Nix is already simple?
  2. One of the main principles of Nix language is being functional and you are just taking that idea and throwing it out the window? To me at least, if Nix wasn’t a proper language then I might not even consider using it in the first place.
  3. @max suggested having an interactive interface for creating flakes which I then went ahead and linked a project that already achieves it. This takes us back to the pet peeve I have I mentioned above.

EDIT: OP has asked to be given feedback on a specific aspect of their project and I went ahead and gave feedback on a more general aspect of the project which OP didn’t ask for. I take this fault on me.

2 Likes

@bketelsen Can you link me some of the generated flakes? because I would like to actually give some proper feedback on them because that’s what you actually asked for in the first place. I couldn’t find any example generated flakes in the repo (the repo has no Nix code in it basically). Maybe it’d be good to add some examples of the generated flakes? I’ll create an issue for that on the repo. (Provide examples of generated flakes · Issue #124 · ublue-os/fleek · GitHub)

EDIT: Is this it? https://github.com/ublue-os/fleek/blob/2b0a2da77cf1c102c259218b06942efe61253dbf/internal/flake. It seems to be using some templating engine right?

1 Like

Great idea, I’ve got a PR inbound with examples here pull request