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

nixos/caddy: improve documentation #28481

Merged
merged 1 commit into from
Aug 25, 2017
Merged

nixos/caddy: improve documentation #28481

merged 1 commit into from
Aug 25, 2017

Conversation

mpcsh
Copy link
Contributor

@mpcsh mpcsh commented Aug 22, 2017

Motivation for this change

There was no documentation for the "config" option, and it wasn't quite clear whether it was supposed to be a file, a string, or what. This commit removes that ambiguity.

Things done

(I haven't done any testing because I've only changed documentation)


Also, the diff is a bit messy because the indentation was off, and my editor fixed it.

{
options.services.caddy = {
enable = mkEnableOption "Caddy web server";
{
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for this. We are in nit-picking territory but the indentation is incorrect. It should either be:

in
{
  options....

or

in {
  options...

That basically throws off the indentation for the rest of the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I didn't catch that. Thank you. Should've looked more carefully. Fixed now, squashed with the original commit.

root /srv/http
}
'';
type = types.string
Copy link
Member

Choose a reason for hiding this comment

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

A semicolon is missing here. Also, this should rather be types.lines so that multiple occurrences of this option will be merged by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! Sorry about that. And cool, I wasn't aware of types.lines. Changes made and squashed with the original commit.

.caddy directory are in the specified data directory instead.
The data directory, for storing certificates. Before 17.09, this
would create a .caddy directory. With 17.09 the contents of the
.caddy directory are in the specified data directory instead.
'';
Copy link
Member

Choose a reason for hiding this comment

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

indentation is wrong here - should be 2, not 4.

@@ -57,10 +67,10 @@ in
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
environment = mkIf (versionAtLeast config.system.stateVersion "17.09")
{ CADDYPATH = cfg.dataDir; };
{ CADDYPATH = cfg.dataDir; };
Copy link
Member

Choose a reason for hiding this comment

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

should be indented

serviceConfig = {
ExecStart = ''
${cfg.package.bin}/bin/caddy -root=/var/tmp -conf=${configFile} \
${cfg.package.bin}/bin/caddy -root=/var/tmp -conf=${configFile} \
-ca=${cfg.ca} -email=${cfg.email} ${optionalString cfg.agree "-agree"}
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't be indented

There was no documentation for the "config" option, and it wasn't quite
clear whether it was supposed to be a file, a string, or what. This
commit removes that ambiguity.
@mpcsh
Copy link
Contributor Author

mpcsh commented Aug 24, 2017

Fixed those @peterhoeg, sorry this has been so messy :/

@peterhoeg peterhoeg merged commit ecdabb1 into NixOS:master Aug 25, 2017
@peterhoeg
Copy link
Member

Thank you @mpcsh - please keep 'em coming!

@mpcsh
Copy link
Contributor Author

mpcsh commented Aug 25, 2017

Appreciate the positivity and your being welcoming of a newbie @peterhoeg :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants