printerfacts/default.nix

27 lines
710 B
Nix
Raw Normal View History

{ sources ? import ./nix/sources.nix, pkgs ? import <nixpkgs> { } }:
2020-05-13 20:38:16 +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 ./.;
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
installPhase = ''
mkdir -p $out/static
2020-05-13 20:38:16 +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
}