site/site.nix

37 lines
1009 B
Nix
Raw Normal View History

2020-07-14 21:14:01 +00:00
{ sources ? import ./nix/sources.nix, pkgs ? import sources.nixpkgs { } }:
with pkgs;
2020-07-14 21:14:01 +00:00
let
srcNoTarget = dir:
builtins.filterSource
(path: type: type != "directory" || builtins.baseNameOf path != "target")
dir;
naersk = pkgs.callPackage sources.naersk { };
gruvbox-css = pkgs.callPackage sources.gruvbox-css { };
src = srcNoTarget ./.;
xesite = naersk.buildPackage {
inherit src;
buildInputs = [ pkg-config openssl ];
remapPathPrefix = true;
};
2020-07-14 21:14:01 +00:00
in pkgs.stdenv.mkDerivation {
inherit (xesite) name;
inherit src;
phases = "installPhase";
2020-07-14 21:14:01 +00:00
installPhase = ''
mkdir -p $out $out/blog $out/css $out/gallery $out/static $out/talks $out/bin
2020-07-14 21:14:01 +00:00
cp -rf $src/config.dhall $out/config.dhall
cp -rf $src/blog $out/blog
cp -rf $src/css $out/css
cp -rf $src/gallery $out/gallery
cp -rf $src/signalboost.dhall $out/signalboost.dhall
cp -rf $src/static $out/static
cp -rf $src/talks $out/talks
2020-07-14 21:14:01 +00:00
cp -rf ${xesite}/bin/xesite $out/bin/xesite
'';
}