{ config, lib, pkgs, ... }: with lib; # use the functions from lib, such as mkIf let cfg = config.services.opengist; src = builtins.fetchTarball { url = "https://github.com/thomiceli/opengist/releases/download/v1.9.1/opengist1.9.1-linux-amd64.tar.gz"; sha256 = "sha256:0cayri7yz792964mq3h52dryjs7rjn3xhw5papi589c8d9a0afw4"; }; in { options = { services.opengist = { enable = mkOption { type = types.bool; default = false; description = '' Whether to enable OpenGist. ''; }; config = mkOption { type = types.path; description = '' The config path to use. ''; }; }; }; config = mkIf cfg.enable { systemd.services.opengist = { path = [ pkgs.git pkgs.openssh ]; name = "opengist.service"; enable = true; script = "${src}/opengist --config ${cfg.config}"; description = "OpenGist"; }; }; }