-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
easytier.services.default: init #476861
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
base: master
Are you sure you want to change the base?
easytier.services.default: init #476861
Conversation
|
|
I don't think it's a good idea to directly use sysctl in preStart, since it disrupts the existing module system. Perhaps we just let users who need kernel forwarding manually configure the sysctl options, as is done in other distributions.
|
3be0efa to
a557a2f
Compare
|
|
||
| options = { | ||
| easytier = { | ||
| package = lib.mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use lib.mkPackageOption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not use mkPackageOption here because package is defined in the place where importApply it.
See package.nix
passthru.services.default = {
imports = [
(lib.modules.importApply ./service.nix { inherit formats bash iproute2; })
];
easytier.package = finalAttrs.finalPackage;
};
| meta.maintainers = with lib.maintainers; [ moraxyc ]; | ||
|
|
||
| options = { | ||
| easytier = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An enable option is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since a modular service is designed to be importable, an additional enable option is no need.
| network_secret = lib.mkOption { | ||
| type = with lib.types; nullOr str; | ||
| default = null; | ||
| description = '' | ||
| EasyTier network credential used for verification and encryption. | ||
| It is highly recommended to use {option}`easytier.environmentFiles` to | ||
| avoid leaking the secret into the world-readable Nix store. | ||
| ''; | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an idea: should we then offer the option at all if it is insecure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer keeping this to provide a clear doc for users to not use it.
| path = [ | ||
| cfg.package | ||
| iproute2 | ||
| bash | ||
| ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not patch that in the package instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, I'm not familiar with packaging easytier. @L-Trump Could you take a look at this?
a557a2f to
b938c69
Compare
An attempt to create a modular service. Please let me know if there’s anything that needs fixing.
It seems there is no way to implement
sysctlat the moment. Should we usepreStartinstead?nixpkgs/nixos/modules/services/networking/easytier.nix
Lines 283 to 286 in 8f8e97e
Tracking: #428084
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.