Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Created December 3, 2016 00:32
Show Gist options
  • Save cleverca22/6a9569071ebca3cb3c114d6540e0a4a2 to your computer and use it in GitHub Desktop.
Save cleverca22/6a9569071ebca3cb3c114d6540e0a4a2 to your computer and use it in GitHub Desktop.
{ stdenv, aedb, writeTextFile, cfg }:
let
config = writeTextFile {
name = "config.php";
text = ''
<?php
$master_server = "${cfg.master}";
$this_server = "${cfg.hostname}";
$base = 'nixos';
'';
};
in
stdenv.mkDerivation {
name = "public_html";
phases = [ "installPhase" ];
installPhase = ''
mkdir -pv $out/dsis/
cp -vi ${aedb}/root/index.php $out/
ln -sv ${aedb}/web/css $out/dsis/
ln -sv ${aedb}/web/java $out/dsis/
ln -sv ${aedb}/web/js $out/dsis/
ln -sv ${aedb}/web/sounds $out/dsis/
ln -sv ${aedb}/web/help $out/dsis/
ln -sv ${aedb}/web/images $out/dsis/
substituteInPlace $out/index.php --replace @AEDB@ ${aedb} --replace @CONFIGFILE@ ${config};
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment