Add nixos build script

This commit is contained in:
Tristan Daniël Maat 2020-07-11 23:51:13 +01:00
parent 06ac44e56d
commit 1160d96b06
Signed by: tlater
GPG key ID: 49670FD774E43268
2 changed files with 35 additions and 0 deletions

28
default.nix Normal file
View file

@ -0,0 +1,28 @@
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
# TODO: Once https://github.com/svanderburg/node2nix/issues/184 is
# fixed, use a proper nixos package instead of a tarball.
stdenv.mkDerivation {
pname = "tlaternet-templates";
version = "1.0";
src = ./dist.tar.gz;
installPhase = ''
mkdir -p $out/srv/
mv browser $out/srv/web
'';
}
# let
# nodePackages = import ./node-packages.nix {
# inherit pkgs;
# };
# in
# nodePackages.package.override {
# buildInputs = [ pkgs.nodePackages.node-gyp-build ];
# postInstall = ''
# npm run build-dist
# '';
# }

7
generate.sh Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix
set -euo pipefail
node2nix --input package.json \
--output node-packages-generated.nix \
--composition node-packages.nix