mirror of
https://github.com/rosenpass/rosenpass.git
synced 2025-12-12 07:40:30 -08:00
39 lines
852 B
Nix
39 lines
852 B
Nix
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.services.rosenpassKeyExchange;
|
|
in
|
|
{
|
|
options.services.rosenpassKeyExchange = {
|
|
enable = lib.mkEnableOption "rosenpass key-exchange";
|
|
config = lib.mkOption {
|
|
type = lib.types.path;
|
|
description = "Path to rosenpass configuration";
|
|
};
|
|
rosenpassVersion = lib.mkOption {
|
|
type = lib.types.package;
|
|
description = "Rosenpass package to use";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
systemd.services.rp-exchange = {
|
|
description = "Rosenpass Key Exchanger";
|
|
wantedBy = [ "multi-user.target" ];
|
|
requires = [ "network-online.target" ];
|
|
script = ''
|
|
${cfg.rosenpassVersion}/bin/rosenpass exchange-config ${cfg.config}
|
|
'';
|
|
serviceConfig = {
|
|
Restart = "always";
|
|
RestartSec = 1;
|
|
};
|
|
};
|
|
};
|
|
}
|