38 lines
693 B
Nix
38 lines
693 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
imports = [ ./etherpad-pkg.nix ];
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.etherpad = {
|
|
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = ''
|
|
Whether to enable etherpad service.
|
|
'';
|
|
};
|
|
};
|
|
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf cfg.enable{
|
|
environment.systemPackages = [pkgs.etherpad pkgs.nosdejs];
|
|
systemd.services.etherpad = {
|
|
description = "etherpad service";
|
|
serviceConfig = {
|
|
Type = "forking";
|
|
ExecStart = "${pkgs.etherpad}/bin/run.sh";
|
|
};
|
|
wantedBy = [ "multi-user.target" ];
|
|
};
|
|
};
|
|
}
|