Skyler Grey | 245a88f | 2023-05-01 21:35:57 +0000 | [diff] [blame] | 1 | { pkgs, config, lib, ... }: { |
| 2 | home.packages = [ pkgs.nodejs-14_x ]; |
| 3 | |
| 4 | services.git-sync = { |
Skyler Grey | 87e6e73 | 2023-05-20 13:48:39 +0200 | [diff] [blame] | 5 | enable = false; |
Skyler Grey | 245a88f | 2023-05-01 21:35:57 +0000 | [diff] [blame] | 6 | |
| 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 | } |