octopod/octopod-css/default.nix
iko 648e654ece
Nixified css (#61)
* Nixified frontend

* Use single nixpkgs

* wip

* Remove prod folder and create www

* Format

* Nixified first dev scripts

* Moved all caddy to nix
2021-08-20 19:31:28 +03:00

44 lines
1.0 KiB
Nix

{ pkgsSrc ? (import ./.. { }).pkgsSrc
, sources ? import ../nix/sources.nix
, nix-filter ? import sources.nix-filter
}:
let
pkgs = pkgsSrc {
overlays = [ (self: super: { nodejs = self.nodejs-10_x; }) ];
};
production-css = pkgs.mkYarnPackage {
name = "octopod-css";
src = nix-filter {
root = ./.;
name = "octopod-css";
include = with nix-filter; [
(inDirectory ./development)
(inDirectory ./favicons)
./gulpfile.js
./package.json
./.stylelintrc.json
];
};
yarnLock = ./yarn.lock;
buildPhase = "yarn run gulp";
doDist = false;
distPhase = " ";
installPhase = ''
runHook preInstall
cp -av deps/octopod-css/production $out
runHook postInstall
'';
};
in
pkgs.runCommand "octopod-production-assets"
{ } ''
mkdir $out
cp -av ${./.}/favicons/* $out
mkdir $out/static
cp -av ${production-css}/images $out/static
cp -av ${production-css}/styles $out/static
cp -av ${production-css}/vendors $out/static
''