Replies: 3 comments
-
|
Did that on my repo vix#137, just moved some files into Now I'll change how This is great, because previously I was thinking (and even started) moving some of my re-usable nix files into |
Beta Was this translation helpful? Give feedback.
-
|
This repo serves to document a pattern. I'd like to see where your experiment goes, but I would say making such a recommendation here out of scope. |
Beta Was this translation helpful? Give feedback.
-
|
I agree, that's why I referred to it as a "recommendation". Anyways, we don't even need that |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
TL;DR. Proposal: Add to README a Dendritic Community Recommendation: Have a
./modules/communitydirectory.I love the fact that the dendritic pattern allows us to have "incremental features".
Something we may even have to document as another advantage of the pattern.
By this I mean, that a single file
feature-a.nixin a repository can define packages and configuredifferent module classes (as any flake-parts module). However, the fact
that this cross-cutting configuration is possible, enables us to potentially
share a well defined
feature-awith the community, while also allowing the very same source repositoryto extend it for the author's particular infra needs. Because, in the dendritic pattern,
we can have as many files inside our
import-treeloaded directory, to increment the featureoriginally defined by the first
feature-a.nixfile.Now, given that most of us already have a
./modulesdirectory from where we importall our .nix files, we could easily have the following
Dendritic Community Recommendation: To have a
./modules/communitysubdirectory.This would not affect any of us functionally, since anyways we already load all of
./modulesand one of the Dendritic unique advantages is that you can move/rename your files freely.
However, having a community sub-tree would allows to move there features that are generic
enough and stable (since we are already using them in our infra) to be provided for others.
How you organize files inside
./modules/communityis still up to your hearts content.But some community conventions could arise in the future from people willing
to be part of something bigger than our individual infra repos.
This way, we could have a repo to be something akin to
nix-community/NUR:A registry of repos willing to share
./modules/communitydendritic configurations fromwhich people can easily pick subtrees:
This
dendritic-communityflake would be just something like:But, why not simply let people reuse our
flake.modules.nixos.feature-amodules,since they are already defined on our flakes?
Yes, that is already possible and also that's why module outputs exist on flakes (to be reused).
However, I see three disadvantages to using flake outputs instead of simply a directory convention:
The first is that there's no convention on how we name our modules (and that's a good thing,
because it allows us to think of the features in our repo as we see fit - eg, some of these modules
are my actual hosts tied to some particular hardware/etc).
I believe a naming convention might araise and only makes sense for things under
./modules/community.Second is that a flake output module is the aggregation of all configs that contribute to the same feature (including the ones particular to my infra hardware).
The third is that if we use a flake output we have to evaluate the flake, and download all the flake inputs.
The
dendritic-communityrepository would make more sense if it only exposes trees of configs.(using
?subtree=modules/communityas in the example above), otherwise we would be better justdirectly adding inputs on user flakes (and dealing with inputs.follows and _dedup)
Imagine that someone wants to load vic's jujutsu/git/wezterm configs without having to
download all the inputs of their flake. If I do need something from vix/community that expects
an input, I'd provide it on my flake. (Is this an anti-pattern on flake.parts?: do not make assumptions about inputs)
Beta Was this translation helpful? Give feedback.
All reactions