default.nix: init

This commit is contained in:
Astro 2020-07-23 01:02:47 +02:00
parent 8c7f936851
commit a5f5e8ad0d
1 changed files with 30 additions and 0 deletions

30
default.nix Normal file
View File

@ -0,0 +1,30 @@
# Build should to be run with `--option sandbox false` as it fetches
# resources from the network.
with import <nixpkgs> {};
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;
}