This commit is contained in:
commit
95a533c876
451 changed files with 18255 additions and 0 deletions
62
docs/modules/nixos/mailserver.md
Normal file
62
docs/modules/nixos/mailserver.md
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# Mail
|
||||
|
||||
A simple NixOS mailserver.
|
||||
|
||||
View the [*synix* NixOS module on Forgejo](https://git.sid.ovh/sid/synix/tree/master/modules/nixos/mailserver).
|
||||
|
||||
## References
|
||||
|
||||
- [docs](https://nixos-mailserver.readthedocs.io/en/latest/index.html)
|
||||
|
||||
## Setup
|
||||
|
||||
Follow the [setup guide](https://nixos-mailserver.readthedocs.io/en/master/setup-guide.html#setup-dns-a-record-for-server).
|
||||
|
||||
## Sops
|
||||
|
||||
Provide every user's hashed password to your host's `secrets.yaml`:
|
||||
|
||||
> Replace `abc123` with your actual secrets
|
||||
|
||||
```yaml
|
||||
mailserver:
|
||||
accounts:
|
||||
user1: abc123
|
||||
user2: abc123
|
||||
# ...
|
||||
```
|
||||
|
||||
Generate hashed passwords with:
|
||||
|
||||
```sh
|
||||
nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
|
||||
```
|
||||
|
||||
## Config
|
||||
|
||||
### `flake.nix`
|
||||
|
||||
```nix
|
||||
inputs = {
|
||||
nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||
nixos-mailserver.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
```
|
||||
|
||||
### Host configuration:
|
||||
|
||||
```nix
|
||||
imports = [ inputs.synix.nixosModules.mailserver ]
|
||||
|
||||
mailserver = {
|
||||
enable = true;
|
||||
accounts = {
|
||||
admin = {
|
||||
aliases = [ "postmaster" ];
|
||||
};
|
||||
alice = { };
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
You may need to set [`mailserver.stateVersion`](https://nixos-mailserver.readthedocs.io/en/master/migrations.html). At the time of writing, you need to set it to `3`, but you should check the mailserver docs yourself.
|
||||
Loading…
Add table
Add a link
Reference in a new issue