Skip to content
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

[RFC 0157] More granular control over the system #157

Closed
wants to merge 6 commits into from

Conversation

Animeshz
Copy link

@Animeshz Animeshz commented Aug 2, 2023

Summary

RFC proposes to grant more granular low-level control over the system (reduction of unnecessary abstractions). This may results in finer, transparent and more accessible setups.

Rendered

rfcs/0157-more-granular-control.md Outdated Show resolved Hide resolved
rfcs/0157-more-granular-control.md Outdated Show resolved Hide resolved
rfcs/0157-more-granular-control.md Outdated Show resolved Hide resolved
rfcs/0157-more-granular-control.md Outdated Show resolved Hide resolved
rfcs/0157-more-granular-control.md Outdated Show resolved Hide resolved
rfcs/0157-more-granular-control.md Outdated Show resolved Hide resolved
rfcs/0157-more-granular-control.md Outdated Show resolved Hide resolved
rfcs/0157-more-granular-control.md Show resolved Hide resolved
rfcs/0157-more-granular-control.md Outdated Show resolved Hide resolved
rfcs/0157-more-granular-control.md Outdated Show resolved Hide resolved
rfcs/0157-more-granular-control.md Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Aug 5, 2023

Could we have more granular control over this RFC?

This seems like (at least) three separate RFCs that have been lumped together.

@Animeshz
Copy link
Author

Animeshz commented Aug 5, 2023

This seems like (at least) three separate RFCs that have been lumped together.

Sure, the decoupling of nixos module is the major one here, that'll enhance the usage of nix in and outside NixOS, I'll try to split rest of them into separate RFC (or remove the parts unneeded, if any) by today's evening within few days.

@Animeshz Animeshz marked this pull request as draft August 9, 2023 14:09
@nyabinary
Copy link

@Animeshz Any progress on that btw?

@Animeshz Animeshz marked this pull request as ready for review September 3, 2023 04:39
@Animeshz
Copy link
Author

Animeshz commented Sep 3, 2023

@nyabinary Sorry I've been really busy with other things, I've reduced the scope of the RFC as others pointed out, now to only aim at allowing to expose more fundamental parts of the system from modules, and make it more flexible to swap components in future.

CC @amjoseph-nixpkgs @AndersonTorres @Ma27 @7c6f434c let me know if this shortened RFC scope is relevant or not :) Marking it open for review!

rfcs/0157-more-granular-control.md Outdated Show resolved Hide resolved

Decoupling the system from fixed parts can be done by availing configuration options under the NixOS modules:

```nix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling it needs a PoC. Maybe creating a small system from power up to bash prompt.

Copy link
Author

@Animeshz Animeshz Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndersonTorres I had started working on the PoC right away that day, although soon I realized it doesn't really relates much to this.

I believe a better idea would be to shrinking down

  • the activation script (rg 'activationScripts\.' on root of nixpkgs clone) - majorly the things that are unconditionally added to the activation script, without choosing any option, even on empty configs.
  • the main derivation's buildCommand that populates the nixos-rebuild output directory.
  • and the etc derivation's buildCommand that populates etc/ subdirectory in the nixos-rebuild output directory.

behind a dedicated option for each of them in the configuration.

That will slowly create options, as well as allocate multiple choices for that options. This can also be slowly integrated into the nixpkgs, as we could do it first for bootloader, then for init, and so on in separate PRs, without touching everything at once.

Let me know what do you think, making things from groundup or shrinking down what's already in there. Because latter one looks much better to do.

@kevincox
Copy link
Contributor

kevincox commented Sep 6, 2023

This RFC is now open for shepherd nominations.

@kevincox kevincox added the status: open for nominations Open for shepherding team nominations label Sep 6, 2023
@infinisil
Copy link
Member

This RFC has not acquired enough shepherds. This typically shows lack of interest from the community. In order to progress a full shepherd team is required. Consider trying to raise interest by posting in Discourse, talking in Matrix or reaching out to people that you know.

If not enough shepherds can be found in the next month we will close this RFC until we can find enough interested participants. The PR can be reopened at any time if more shepherd nominations are made.

See more info on the Nix RFC process here

@Aleksanaa
Copy link
Member

But how do you support multiple init/service supervisor without adding an abstraction layer? Requiring every service maintainer to write service configuration (that is already very low level btw) in a couple of other formats again and again? Or letting the users write services themselves?

For other parts (boot method, libc, kernel and so on) the abstraction layer shouldn't be the blocking issue. The real problem is we lack people actively creating, maintaining and using different implementations with great interest. without a lot of continuous investment, these implementations will quickly become unusable.

@aanderse
Copy link
Member

I'm interested in being a shepherd for this RFC. Hopefully some other interested parties will show up as well.

@AndersonTorres
Copy link
Member

I personally believe this RFC will hugely benefit from #163.

@Animeshz
Copy link
Author

Animeshz commented Oct 15, 2023

I personally believe this RFC will hugely benefit from #163.

Yes, since the generalization of service management is handled by that RFC in detail, it'll remove some unanswered questions about service creations and reduce a huge load on this.


Also, on the #163 (comment),

I have a plan to assimilate Home Manager to Nixpkgs repo.
Can your RFC help this transition, since it would provide a portable service layer to HM too?

If we eliminate the assumptions NixOS makes, about the system, a part of this RFC, the home-manager can also be easily merged into nixpkgs as nixos module itself (theoretically), and then nixos modules can be used inside/outside NixOS.

@nyabinary
Copy link

I personally believe this RFC will hugely benefit from #163.

Yes, since the generalization of service management is handled by that RFC in detail, it'll remove some unanswered questions about service creations and reduce a huge load on this.

Also, on the #163 (comment),

I have a plan to assimilate Home Manager to Nixpkgs repo.
Can your RFC help this transition, since it would provide a portable service layer to HM too?

If we eliminate the assumptions NixOS makes, about the system, a part of this RFC, the home-manager can also be easily merged into nixpkgs as nixos module itself (theoretically), and then nixos modules can be used inside/outside NixOS.

Wouldn't including home-manaager into NixOS/nixpkgs include a lot of refactorings?

@Animeshz
Copy link
Author

I personally believe this RFC will hugely benefit from #163.

Yes, since the generalization of service management is handled by that RFC in detail, it'll remove some unanswered questions about service creations and reduce a huge load on this.
Also, on the #163 (comment),

I have a plan to assimilate Home Manager to Nixpkgs repo.
Can your RFC help this transition, since it would provide a portable service layer to HM too?

If we eliminate the assumptions NixOS makes, about the system, a part of this RFC, the home-manager can also be easily merged into nixpkgs as nixos module itself (theoretically), and then nixos modules can be used inside/outside NixOS.

Wouldn't including home-manaager into NixOS/nixpkgs include a lot of refactorings?

Technically, the types in home-manager such as dag & gvariant may benefit nixpkgs modules. And regarding refactorings, yes, it might incur a few, but since home-manager is primarily focused on files on $HOME, I don't think there'd be a lot of overlap and hence easily integratable. If however, some package can be configured both ways (system and home level) then probably something has to be done to deduplicate and reduce the confusion among the config options.

@edolstra
Copy link
Member

edolstra commented Nov 1, 2023

This RFC is being closed due to lack interest. If enough shepherds are found this issue can be reopened. If you don't have permission to reopen please open an issue for the NixOS RFC Steering Committee linking to this PR.

@nyabinary
Copy link

I'm interested in being a shepherd for this RFC. Hopefully some other interested parties will show up as well.

Wasn't this party interested in being a shepherd?

@aanderse
Copy link
Member

aanderse commented Nov 1, 2023

No one else expressed interest though, right? 1 person isn't enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: open for nominations Open for shepherding team nominations
Projects
None yet
Development

Successfully merging this pull request may close these issues.