1
0
nixfiles/modules/chisel/default.nix
2021-07-23 23:33:03 +02:00

28 lines
549 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.clerie.chisel;
in {
options = {
clerie.chisel = {
enable = mkEnableOption "Chisel Tunnel Service";
};
};
config = {
systemd.services.chisel = mkIf cfg.enable {
description = "Chisel Tunnel";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
ExecStart = "${pkgs.chisel}/bin/chisel server --port 443 --authfile /var/src/secrets/chisel/users.json";
Restart = "always";
};
};
};
}