2021-01-02 01:52:07 +00:00
|
|
|
{ sources ? import ./nix/sources.nix, pkgs ? import <nixpkgs> { } }:
|
2020-05-13 20:38:16 +00:00
|
|
|
let
|
2021-01-02 01:52:07 +00:00
|
|
|
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 ./.;
|
|
|
|
pfacts = naersk.buildPackage {
|
|
|
|
inherit src;
|
|
|
|
remapPathPrefix = true;
|
|
|
|
};
|
|
|
|
in pkgs.stdenv.mkDerivation {
|
|
|
|
inherit (pfacts) name;
|
|
|
|
inherit src;
|
|
|
|
phases = "installPhase";
|
2020-05-13 20:38:16 +00:00
|
|
|
|
2021-01-02 01:52:07 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/static
|
2020-05-13 20:38:16 +00:00
|
|
|
|
2021-01-02 01:52:07 +00:00
|
|
|
cp -rf $src/templates $out/templates
|
|
|
|
cp -rf ${pfacts}/bin $out/bin
|
|
|
|
cp -rf ${gruvbox-css}/gruvbox.css $out/static/gruvbox.css
|
|
|
|
'';
|
2020-05-13 20:38:16 +00:00
|
|
|
}
|