feat: initial commit
This commit is contained in:
commit
486bfc17d1
11 changed files with 551 additions and 0 deletions
43
config/services/opengist.nix
Normal file
43
config/services/opengist.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ 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";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue