Browse Source

feat: Add shell.nix for faster development

develop
Dale 1 month ago
parent
commit
1724b7b639
3 changed files with 27 additions and 9 deletions
  1. +7
    -8
      default.nix
  2. +1
    -1
      package.json
  3. +19
    -0
      shell.nix

+ 7
- 8
default.nix View File

@@ -3,17 +3,17 @@ with import <nixpkgs> {};
let
executableName = "miracle-tv-server";
version = "0.1.0";
src = fetchgit {
url = "https://code.gensokyo.social/Gensokyo.social/miracle-tv.git";
rev = "493c80142637b6fc47c864dfb51a1cba2f391150";
sha256 = "1a5ih7jbdkkapmih11jk4y95nk6ppvns5lg0aqv76kd9y9c8v26s";
};
# src = ./.;
# src = fetchgit {
# url = "https://code.gensokyo.social/Gensokyo.social/miracle-tv.git";
# rev = "493c80142637b6fc47c864dfb51a1cba2f391150";
# sha256 = "1a5ih7jbdkkapmih11jk4y95nk6ppvns5lg0aqv76kd9y9c8v26s";
# };
src = ./.;
nodePkg = pkgs.nodejs-12_x;
yarnPkg = pkgs.yarn.override { nodejs = nodePkg; };
in mkYarnPackage rec {
name = "miarcle-tv";
inherit version src;
inherit version src nodePkg yarnPkg;

doDist = false;

@@ -49,7 +49,6 @@ in mkYarnPackage rec {

nativeBuildInputs = with pkgs; [
nodePkg yarnPkg makeWrapper
yarn2nix
automake autoconf m4 git bash
libpng libGL gcc
];


+ 1
- 1
package.json View File

@@ -5,7 +5,7 @@
"author": "Dale <deiru2k@gmail.com>",
"license": "MIT",
"private": false,
"engines" : { "node" : ">=14.0" },
"engines" : { "node" : ">=12.0" },
"scripts": {
"test": "./bin/testServer.sh",
"test:mocha": "NODE_PATH=./src ./node_modules/.bin/mocha",


+ 19
- 0
shell.nix View File

@@ -0,0 +1,19 @@
{ pkgs ? import <nixpkgs> {} }:

with pkgs;

let
miraclePkg = (import ./default.nix);
src = ./.;
in mkShell {
shellHook = ''
export PATH=$PATH:$(pwd)/node_modules/.bin
export node_modules=$(pwd)/node_modules
yarn
'';
buildInputs = [
miraclePkg.nodePkg miraclePkg.yarnPkg makeWrapper
automake autoconf m4 git bash
libpng libGL gcc
];
}

Loading…
Cancel
Save