blob: 80fbd433bcbed20f18c4a4c94222bf86f0ffb27c [file] [log] [blame]
Skyler Grey245a88f2023-05-01 21:35:57 +00001{ pkgs, config, lib, ... }: {
2 home.packages = [ pkgs.nodejs-14_x ];
3
4 services.git-sync = {
Skyler Grey87e6e732023-05-20 13:48:39 +02005 enable = false;
Skyler Grey245a88f2023-05-01 21:35:57 +00006
7 repositories = {
8 "etherpad" = {
9 path = "${config.home.homeDirectory}/etherpad/";
10 uri = "https://github.com/ether/etherpad-lite";
11 };
12 };
13 };
14
15 systemd.user.services = {
16 git-sync-etherpad.Service = {
17 Environment = [
18 "GIT_SYNC_EXECHOOK_COMMAND=${pkgs.systemd}/bin/systemctl restart etherpad --user"
19 "GIT_SYNC_REV=1.8.18"
20 "GIT_SYNC_ONE_TIME=true"
21 ];
22 ExecStart = lib.mkForce (builtins.replaceStrings [ "\n" ] [ "" ]
23 ''${pkgs.bashInteractive}/bin/sh -c "
24 ${pkgs.coreutils}/bin/mkdir -p ${config.services.git-sync.repositories.etherpad.path}
25 && cd ${config.services.git-sync.repositories.etherpad.path}
26 && ${pkgs.git}/bin/git clone ${config.services.git-sync.repositories.etherpad.uri} .
27 && ${pkgs.git}/bin/git checkout $GIT_SYNC_REV
28 ; ${config.services.git-sync.package}/bin/git-sync"'');
29 };
30 /* etherpad = { */
31 /* Unit.Description = "A service to run etherpad"; */
32
33 /* Install.WantedBy = [ "default.target" ]; */
34
35 /* Service = rec { */
36 /* ExecStart = "${pkgs.bashInteractive}/bin/sh -c \"export PATH=$PATH:/run/current-system/sw/bin && ${WorkingDirectory}src/bin/run.sh\""; */
37 /* Restart = "always"; */
38 /* WorkingDirectory = "${config.home.homeDirectory}/etherpad/"; */
39 /* }; */
40 /* }; */
41 };
42}