+/config

my dotfiles and nix configuration

git clone https://git.julia.blue/+/config

Julia RyanUse ragenix for secrets265c7f3

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