nixos/services.pfix-srsd: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-24 22:05:35 +02:00
parent 1fbae04bff
commit 8491fdcc31

View File

@ -1,7 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
{ {
###### interface ###### interface
@ -9,25 +6,25 @@ with lib;
options = { options = {
services.pfix-srsd = { services.pfix-srsd = {
enable = mkOption { enable = lib.mkOption {
default = false; default = false;
type = types.bool; type = lib.types.bool;
description = "Whether to run the postfix sender rewriting scheme daemon."; description = "Whether to run the postfix sender rewriting scheme daemon.";
}; };
domain = mkOption { domain = lib.mkOption {
description = "The domain for which to enable srs"; description = "The domain for which to enable srs";
type = types.str; type = lib.types.str;
example = "example.com"; example = "example.com";
}; };
secretsFile = mkOption { secretsFile = lib.mkOption {
description = '' description = ''
The secret data used to encode the SRS address. The secret data used to encode the SRS address.
to generate, use a command like: to generate, use a command like:
`for n in $(seq 5); do dd if=/dev/urandom count=1 bs=1024 status=none | sha256sum | sed 's/ -$//' | sed 's/^/ /'; done` `for n in $(seq 5); do dd if=/dev/urandom count=1 bs=1024 status=none | sha256sum | sed 's/ -$//' | sed 's/^/ /'; done`
''; '';
type = types.path; type = lib.types.path;
default = "/var/lib/pfix-srsd/secrets"; default = "/var/lib/pfix-srsd/secrets";
}; };
}; };
@ -35,7 +32,7 @@ with lib;
###### implementation ###### implementation
config = mkIf config.services.pfix-srsd.enable { config = lib.mkIf config.services.pfix-srsd.enable {
environment = { environment = {
systemPackages = [ pkgs.pfixtools ]; systemPackages = [ pkgs.pfixtools ];
}; };