From 1160d96b064531f65290e2d665c7c8d05fc3d29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Sat, 11 Jul 2020 23:51:13 +0100 Subject: [PATCH] Add nixos build script --- default.nix | 28 ++++++++++++++++++++++++++++ generate.sh | 7 +++++++ 2 files changed, 35 insertions(+) create mode 100644 default.nix create mode 100755 generate.sh diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..f44f357 --- /dev/null +++ b/default.nix @@ -0,0 +1,28 @@ +{ pkgs ? import {} }: + +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 +# ''; +# } diff --git a/generate.sh b/generate.sh new file mode 100755 index 0000000..05cdda4 --- /dev/null +++ b/generate.sh @@ -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