From a5f5e8ad0d690982cf4b5bb9834051c18edefd50 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 23 Jul 2020 01:02:47 +0200 Subject: [PATCH] default.nix: init --- default.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 000000000..ebe6fa04a --- /dev/null +++ b/default.nix @@ -0,0 +1,30 @@ +# Build should to be run with `--option sandbox false` as it fetches +# resources from the network. + +with import {}; + +let + # Select the assets needed for build but not {build,www,.git} or + # any temporary stuff. + sources = [ "Makefile" "content" "dtd" "scripts" "xsd" "xsl" ]; + src = runCommand "c3d2-web-Makefile" {} ( + '' + mkdir $out + '' + + (lib.concatMapStrings (name: '' + ln -s ${./. + "/${name}"} $out/${name} + '') sources + ) + ); +in +stdenv.mkDerivation { + name = "c3d2-web"; + inherit src; + buildInputs = (import ./shell.nix).buildInputs; + enableParallelBuilding = true; + makeFlags = [ "www" ]; + installTargets = [ "export" ]; + installFlags = [ "DESTDIR=$$out" ]; + # 2038-01-19 03:14:08 + SOURCE_DATE_EPOCH = 2147483648; +}