-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
devos-as-library #214
Comments
To complement the collaboration model to somebody who wants to extend devos lib itself, we can recommend to do it as a patch / PR in the spirit (and anticipation) of NixOS/nix#3920 That encourages to surface community work and increases the amount of opportunities to generate consensus. |
I like this a lot 👍 as I mentioned earlier, I would prefer it if we first actually create the library function for mkFlake and have that not implement a new api design and just implement the current api. And then once we finalize the devos api, we can do another PR to update mkFlake/evalArgs. |
On the proposed api itself. An Not really sure what to do with 'name', I feel like name is just the repo name and that doesn't need to be passed to We should also decide on where to use auto-import magic. I'm fine with it as its used right now. hosts are auto-imported and have clear rules for how they are imported. Profiles are technically auto-imported, but because of how suites work, you still explicitly have to select suites, so I think thats ok. |
This was the intention. I don't know why, but selecting profiles to use directly by path felt kind of like a hack to me. Even though the attribute values are really just the very same path, it makes the api very explicit for profiles, and doesn't confuse their usage with other imports, such as new module options. I also didn't want to enforce this for users who may just prefer the workflow of managing imports the old fanshioned way. The auto imports for hosts was originally conceived for two reasons:
Number one may no longer be an issue as users become more familiar to with flakes and their API. Number two still seems like it's nice to have, but may be easily extended to include directories for more involved host systems. As an aside, I would like to encourage upstream, at some point, to change the |
I'd say I'm pretty familiar with the flakes api now mostly due to working on this repo. But I still like the auto-import for hosts. I think its nice to have a folder where all hardware/server specific information goes. And I would personally prefer it to be auto imported with a specific file system hierarchy.
could map to {
minecraft = {
default = ./minecraft;
};
matrix = {
default = ./matrix.nix;
bridges = ./matrix/bridges.nix;
};
} The api could probably use some work, maybe not have the |
I was thinking whatever the end result that it should be used for both profiles and hosts, accentuating that hosts are essentially a subset of profiles with more specific information. That way, if users have questions about the auto-import logic, they only have to reference a single libary function. In a previous iteration of DevOS (essentially my personal dotfiles of stable nix) I had a similar auto import feature for speed of development, where I excluded any nix files that started with We could also invert the logic and only import profiles that start with a special prefix, ignoring all other nix files besides |
Yeah 👍 on a standard auto-import magic function. But I think it would be good to accept both either a path or an attrset that can describe the hosts/profiles in a standard way. I guess thats only necessary if theres enough people that actively don't want auto-importing. So if most of the frustration for auto-import can be fixed by a standard function and some documentation then its unnecessary. |
We might make it easier to extend |
If anyone is interested in a reference for something similar, I wrote a flake inspired by devos that can actually be inherited by other flakes as a personal experiment (and extensibility is as easy as https://github.com/ArctarusLimited/arnix - the base |
An example community sharing model implies people not only using The user Hence it appears to me that those use cases can only be solved with reasonably unique name spacing: There is still a twist to this, for ease of use and back-compat, blaggacao could just reference his kakoune through
Not too bad 😄 Although we might just run them through a
I see, because it accessors |
Interesting I think I see the use case. But I would generally prefer the alternative, others can access my packages with inputs.pacman99/pkgs.pacman99. But I only have to do pkgs. And nix flakes already creates some form of namespacing when you add an input.. I gues this would not work great with modules that also need custom packages. In that case you would have to import the module, and then in So I'm not against namespacing and I see the benefits. But we should be careful to maintain a balance between convenience(easily accessing your own packages) and sharing(easy to export and import other peoples code).
With the current mkFlake PR this is no longer true, you have to import the file. Since there is no longer a default location. |
Great point. Havn't thought of that. So it looks like the most straight forward solution is to indeed treat the devos community as a global unique namespace and namespace properly all the way through. As a side effect, this also asserts awareness that everyone acts "as a (good) devos citizen in a global namespace". The thought is not mine, btw. I just derived it from how |
@blaggacao Could you actually create this as a PR to add an API.md or something to doc. That way we can create threads for specific parts of it and request changes. Soft of like nixos rfc process. It doesn't have to actually be merged anytime soon, it would just be easier to discuss with. |
A central part of devos as a library is going to require some additional convenience added to the current template. One might think, at first, that the interface to templates restricts derivations since it only accepts a path, until you remember lazy linkage to We could further fenangle arguments to the builder. Although this would be only from the source because flakes' lack of arguments, this is a template so users are expected to have a copy anyhow. This would give us simple custimization of the template itself as various |
I like the idea, I think it would really improve on boarding for new users. And maybe we could allow users to mix and match things from community and core, so you can pull the 'community profile' template while using the 'core modules' template. |
While prototyping on blaggacao#10, I also realized that |
I figured the Not exactly sure how that would be invoked with
Just an idea leveraging pure |
This is implemented via In an effort to clean up issues, I'm going to close this. |
Proposed API (v0.2)
Rationale
(tbd — will redact later)
Related / Affected / Solvable
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: