add ethernetpad
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
./services/enabled.nix
|
./services/enabled.nix
|
||||||
./users.nix
|
./users.nix
|
||||||
./module/news2kindle/news2kindle.nix
|
./module/news2kindle/news2kindle.nix
|
||||||
|
./module/etherpad/etherpad.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|||||||
54
module/etherpad/etherpad.nix
Normal file
54
module/etherpad/etherpad.nix
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
###### 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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
{ stdenv, fetchFromGitHub }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name= "etherpad-${version}";
|
||||||
|
version = "1.6.2";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "ether";
|
||||||
|
repo = " etherpad-lite";
|
||||||
|
rev = "${version}";
|
||||||
|
sha256 = "1zzx851603apysmzgxn6zqg779yak8r5vnafycy454wcgq6lb0bf";
|
||||||
|
};
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/
|
||||||
|
cp -R . $out/
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -11,5 +11,6 @@
|
|||||||
./news2kindle.nix
|
./news2kindle.nix
|
||||||
./resilio.nix
|
./resilio.nix
|
||||||
./sks.nix
|
./sks.nix
|
||||||
|
./etherpad.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
14
services/etherpad.nix
Normal file
14
services/etherpad.nix
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."pad.stubbe.rocks" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/".proxyPass = "http://localhost:9001";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.etherpad = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user