olivefs/nixos_modules/olivefsd_config.nix
Olivier 'reivilibre 807968bac1
Some checks are pending
ci/woodpecker/push/check Pipeline is pending
ci/woodpecker/push/release Pipeline was successful
Add experimental NixOS module
2022-05-25 21:56:18 +01:00

30 lines
501 B
Nix

{ cfg, lib }:
let
clientSection =
clientName:
''
[clients.${clientName}]
'';
clientSections = map clientSection cfg.clients;
in
''
[listen]
listen_to = "${cfg.bindHost}:${builtins.toString cfg.bindPort}"
# Must be kept secret.
server_key = "${cfg.serverKeyFile}"
server_certificate = "${cfg.serverCertFile}"
ca_certificate = "${cfg.caCertFile}"
timeout = ${builtins.toString cfg.idleTimeout}
[service]
root = "${cfg.rootDir}"
${lib.strings.concatStrings clientSections}
''