-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add group and reloadServices options to ssl block
- Loading branch information
Showing
3 changed files
with
119 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,10 @@ The contract for this block is defined in [`/modules/contracts/ssl.nix`](@REPO@/ | |
|
||
Every module implementing this contract provides the following options: | ||
|
||
- `domain`: Domain to generate the certificate for. | ||
- `extraDomains`: Other domains the certificate should be generated for. | ||
- `group`: The unix group owning this certificate. | ||
- `reloadServices`: Systemd services to reload when the certificate gets renewed. | ||
- `paths.cert`: Path to the cert file. | ||
- `paths.key`: Path to the key file. | ||
- `systemdService`: Systemd oneshot service used to generate the certificate. | ||
|
@@ -53,15 +57,21 @@ shb.certs.certs.selfsigned = { | |
ca = config.shb.certs.cas.selfsigned.myca; | ||
domain = "example.com"; | ||
group = "nginx"; | ||
reloadServices = [ "nginx.service" ]; | ||
}; | ||
"www.example.com" = { | ||
ca = config.shb.certs.cas.selfsigned.myca; | ||
domain = "www.example.com"; | ||
group = "nginx"; | ||
}; | ||
}; | ||
``` | ||
|
||
The group has been chosen to be `nginx` to be consistent with the examples further down in this | ||
document. | ||
|
||
### Let's Encrypt {#ssl-block-impl-lets-encrypt} | ||
|
||
Defined in [`/modules/blocks/ssl.nix`](@REPO@/modules/blocks/ssl.nix). | ||
|
@@ -71,6 +81,7 @@ We can ask Let's Encrypt to generate a certificate with: | |
```nix | ||
shb.certs.certs.letsencrypt."example.com" = { | ||
domain = "example.com"; | ||
group = "nginx"; | ||
dnsProvider = "linode"; | ||
adminEmail = "[email protected]"; | ||
credentialsFile = /path/to/secret/file; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters