added nodejs to flake

This commit is contained in:
David Mosbach 2023-08-24 01:07:51 +02:00
parent 35184a451c
commit bfdb0a97e7
3 changed files with 14 additions and 9 deletions

View File

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
{
description = "Develop environment for the Workflow Visualiser";
description = "Development environment for the Workflow Visualiser";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
@ -43,17 +43,20 @@
devShell = {
enable = true;
mkShellArgs.shellHook = ''
if command -v zsh &> /dev/null; then
zsh && exit
fi
'';
mkShellArgs = {
shellHook = ''
if command -v zsh &> /dev/null; then
zsh && exit
fi
'';
buildInputs = with pkgs; [ nodejs_18 reuse ];
};
# Programs you want to make available in the shell.
# Default programs can be disabled by setting to 'null'
# tools = hp: { fourmolu = hp.fourmolu; ghcid = null; };
hlsCheck.enable = true;
hlsCheck.enable = true;
};
};

View File

@ -4,7 +4,7 @@
"description": "Visualiser for Uni2work workflows",
"type": "module",
"scripts": {
"start": "start.sh",
"start": "./start.sh",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {

4
start.sh Normal file → Executable file
View File

@ -1,3 +1,5 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2023 David Mosbach <david.mosbach@campus.lmu.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
@ -6,4 +8,4 @@
echo 'transpiling to JS...'
npx tsc
echo 'starting server...'
npx http-server --cors -o ./editor.html
npx http-server --cors -o ./editor.html