+/config
my dotfiles and nix configuration
git clone https://git.julia.blue/+/config
265c7f3
main
1{ config , lib , pkgs , ...} :let 2cfg = config . services . rust-rpxy ; 3toml = pkgs . formats . toml {}; 4configFilePath = toml . generate "config.toml" cfg . config ; 5in { 6options . services . rust-rpxy = { 7enable = lib . mkEnableOption ( lib . mdDoc "Rust Reverse Proxy" ); 8config = lib . mkOption { 9default = { }; # TODO, add default and specific options 10type = toml . type ; 11description = lib . mdDoc '' 12Configuration for rust-rpxy. See 13<https://github.com/junkurihara/rust-rpxy/blob/develop/config-example.toml>. 14'' ; 15}; 16}; 17 18config = lib . mkIf cfg . enable { 19environment . systemPackages = [ pkgs . rust-rpxy ]; 20systemd . services . rust-rpxy = { 21wantedBy = [ "multi-user.target" ]; 22serviceConfig = { 23ExecStart = [ " ${ lib . getExe pkgs . rust-rpxy } --config ${ configFilePath } " ]; 24}; 25}; 26}; 27}