diff options
Diffstat (limited to 'users/ryan/modules/simple-bar/server.nix')
| -rw-r--r-- | users/ryan/modules/simple-bar/server.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/users/ryan/modules/simple-bar/server.nix b/users/ryan/modules/simple-bar/server.nix new file mode 100644 index 0000000..f9b636c --- /dev/null +++ b/users/ryan/modules/simple-bar/server.nix | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | { pkgs, lib, ... }: | ||
| 2 | let | ||
| 3 | src = builtins.fetchGit { | ||
| 4 | url = "https://github.com/Jean-Tinland/simple-bar-server.git"; | ||
| 5 | rev = "0c99921d023b459e44bbba8cca6d8947262359b6"; | ||
| 6 | shallow = true; | ||
| 7 | }; | ||
| 8 | |||
| 9 | simple-bar-server = pkgs.buildNpmPackage { | ||
| 10 | pname = "simple-bar-server"; | ||
| 11 | version = "0-unstable"; | ||
| 12 | inherit src; | ||
| 13 | |||
| 14 | npmDepsHash = "sha256-JKUiOqAAoE/TJriErvaaT03uKtX8t1gFh+JzG4GcriI="; | ||
| 15 | dontNpmBuild = true; # no build script, it's just a server | ||
| 16 | |||
| 17 | installPhase = '' | ||
| 18 | runHook preInstall | ||
| 19 | mkdir -p $out/lib/simple-bar-server | ||
| 20 | cp -r . $out/lib/simple-bar-server/ | ||
| 21 | runHook postInstall | ||
| 22 | ''; | ||
| 23 | }; | ||
| 24 | in | ||
| 25 | { | ||
| 26 | enable = true; | ||
| 27 | config = { | ||
| 28 | ProgramArguments = [ "${pkgs.nodejs}/bin/node" "${simple-bar-server}/lib/simple-bar-server/index.js" ]; | ||
| 29 | KeepAlive = true; | ||
| 30 | RunAtLoad = true; | ||
| 31 | StandardOutPath = "/tmp/simple-bar-server.out.log"; | ||
| 32 | StandardErrorPath = "/tmp/simple-bar-server.err.log"; | ||
| 33 | }; | ||
| 34 | } | ||
