Does anyone know of any examples of flake-parts being used in a NixOS/home-manager configuration that one could learn from?
I think I still did not understand how flake-parts works by the end of the video or even what it is attempting to solve. I’m not sure how to apply this to my NixOS configuration or whether it’s even useful for my type of setup (a small multi-user and multi-system setup for a couple personal machines and a home server).
I haven’t gotten much into flake-parts, but my understanding is that it creates a module system very similar to NixOS modules and Home Manager modules. Except that instead of defining a system configuration, flake-parts modules define flake outputs.
So I don’t think you would use it in your NixOS configuration. If your configuration uses a flake there might be use cases for using it at the flake level. For example your flake defines a
nixosConfigurationsoutput, which is a set with an attribute for each host. If you had some unusually complicated code in that flake output you might use flake-parts to modularize it.Or I suppose flake-parts is largely aimed at simplifying per-system outputs like
packagesanddevShells. Once again, if you wanted to split those definitions over multiple files flake-parts can do that. Or you can use it just to get flake-parts’eachDefaultSystemhelper if you don’t want to use equivalent functionality from flake-utils, or the built-ingenAttrsfunction.Although I love the NixOS module system, I haven’t used flake-parts because I haven’t had a case where I want reusable modules in the context of flake outputs. Usually my flakes are a pretty uncomplicated combination of
genAttrs, basic devShells, basic overlays, and package expressions that I build withcallPackage.




