-
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
Toward a stable filesystem api #152
Comments
Can you explain what you mean by out? And why things like overlays and pkgs go there? And I'm not sure how to fix this or if it should be changed, but its pretty annoying that to edit a profile you now have to go three directories down(including profile folder). I feel like profiles are the most used folder. But overall I do like the separation of different folders. |
@Pacman99, I agree, profiles are only two levels deep if you look carefully, but this still may not be optimal. Might have gone overboard with nesting, and still not sure exactly how many internal flakes we should have. Just wanted to brainstorm here. We can take as long as we need to get it right, but I do want to get a PR open fairly soon, so we can start scrutinizing actual code. out is short for flake outputs. Essentially each output would have it's own folder, and for that output, the flake would do an import, e.g. In general, don't take the visual in the OP too seriously, it is really meant more as a cue to help everyone understand which direction my brain was going. I'm sure the final product will look much different. |
I'm going to pack top level with other things:
So keeping top level clean(er) is indeed a thing that would be useful for my use case. |
Indeed, the nesting can be mitigated mostly by generating the template from the |
Yeah, to include docs would be good, since it is a very handy trampoline for extending on all sorts of documentation. |
We should be able to actually let users decide if they want docs or not. A naive implementation is one template with, one without the docs. |
Since this is 1.0, and nickel seems like a big part of the "nix" future, I would really like a contract to guarantee the spec. This may be possible already. |
- [x] refactor lib into separate files, similar to NixOS/nixpkgs/lib. - [x] refactor ci to automatically generate derivations from flake outputs - [x] remove cluttered indirection statements throughout the codebase - [x] refactor hosts to allow for upcoming integration tests - [x] improve ambiguity in the existing docs - [x] add [BORS](https://bors.tech) support - [x] add initial integration test - [x] write tests documentation - [x] test lib - [x] improve version string generation, and do so automatically for pkgs/flake.nix sources Clean up the codebase as best we can in preparation for #152 and add tests. From now on, all PRs will be merged with BORS.
ping: update proposal to second draft, accentuating thesis. |
https://github.com/divnix/devos/blob/core/pkgs/flake.nix I dont understand the idea of subflakes, can you explain your reasoning? Or is there an old topic I can look at about it? This flake seems like a lot of code to just parsing version/rev numbers from |
The main advantage is that The main disadvantage is that it introduces a new {
src = srcs.mypackage-flake-input;
}
# vs
{
src = fetchurl ( ... );
} Other than that, the behavior, especially |
I go back and forth on this. On the one hand, modifying the hash to upstream really isn't so much work. On the other, it kinda makes the source opaque, and the interface for subflakes isn't the best atm. I'm hoping there will be some usability improvements for internal flakes at some point that decide the issue in my mind. I want something like The way the lock file is updated is kinda strange as well, and seems to cause some strange issues. The good news is, you can just not specify your source in pkgs/flake.nix if you'd rather do it the old way, that's a perfectly acceptable option. If that wasn't the case, I might be tempted to revert for now. Either way, I'll probably hold off on adding more subflakes until this becomes easier to deal with. |
Yeah I think its a lot of complexity just to deal with 1 rev hash, that will need to be undone anyways before being added to nixpkgs. And yes, i already had that exact issue with it-- updating the 'subflake' leads to a bad NAR hash to your main flake. Thats originally why I had to inspect the Also the way its called is done by relative path at the moment. Which when I need to act on my flake repository locally i have to be within the exact root directory where the flake is located. I think it's not a directory where you'd want to mass update the hashes/commits of repos either, because you're in the progress of getting them upstreamed to nixpkgs individually and not all at once. So I don't see the utility of Just my feedback after having updated from a state before "suites", which ive come to like! |
Also, I might add, that it sometimes becomes a little redundant to re-declare a ref, usually a version tag that also holds the Maybe ther would be a way to revert this and rather think of how to otherwise helpmpeople withbupdating their hashes (it's not too bad, but it is annoying). |
With the recent changes in 0.9 and the dropping of extern in #264, are there still any problems with the filesystem api? |
I think we are definitely close. Maybe we should leave this open, at least until the next release, and see what state we are in at that time. |
Closable via #293 |
should this issue be unpinned as it is closed? |
Second Draft
We need to adapt to Nix now being a language with a proper module system, considering flakes to be essentially equivalent to a module in other languages. This should help create clear and distinct lines between different elements of the system, and keeps private code from leaking. For example, profiles could be it's own subflake of DevOS, which exports all profiles as
nixosModules
to then be consumed by the parent flake. Not every directory need be a flake, and many of the existing directory folders could be grouped together in a shared flake to reduce the complexity of the filesystem layout, without sacrificing any of the already established conveniences of DevOS.This has the added benefit of allowing power users to pull only relevant pieces of DevOS, such as it's lib, in a flake ref:
"github:divnix/devos?dir=lib"
.Impetus
In a word: complexity.
From the very first moment of deploying DevOS to the world, I knew the fs hierarchy had to change. I was hoping to illicit feedback from the community. As an example, one of the complaints I hear echoed is the default imports, which happen it different ways in different places, and if kept at all should definitely be reduced to a simpler implementation. This issue will remain open until a solid layout has been decided on, so we don't have to continue changing it out from under users. I want a flake centric approach, and internal flakes seem like the right way to manage access, at least from a high level.
For example, with this approach we should be able to maintain the convenience of the current doc setup, i.e a README.md in every directory explaining it's use, without actually needing the book.toml and SUMMARY.md in the root. We can just pull in the
src
flake to thedoc
flake, and overlay the book.toml onto it to generate the book.Once a demo is achieved that maintains all the established conveniences of current DevOS, and a proof-of-concept for #127, I will open a PR that we can then scrutinize.
Changes
We would turn off the github template, and generate the template as a derivation with the docs optionally included for users. This will eliminate one level of nesting for users, while also eliminated irelevant code from the users template.
Goal
This won't change once 1.0 is reached, so we need to get it right, aiming at convenience for users without restricting what they can do.
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: