mi/default.nix

31 lines
826 B
Nix
Raw Normal View History

2020-11-07 17:29:47 +00:00
{ sources ? import ./nix/sources.nix, pkgs ? import sources.nixpkgs { } }:
with pkgs;
let
backend = pkgs.callPackage ./backend { inherit sources pkgs; };
2020-11-15 20:52:57 +00:00
frontend = pkgs.callPackage ./sina { inherit sources pkgs; };
2020-11-07 17:29:47 +00:00
gruvbox = pkgs.callPackage sources.gruvbox-css { };
in stdenv.mkDerivation {
pname = "mi";
version = "${backend.version}";
phases = "installPhase";
installPhase = ''
# service binary
mkdir -p $out/bin
for file in ${backend}/bin/*; do
ln -s ${backend}/bin/$(${coreutils}/bin/basename $file) $out/bin/$(${coreutils}/bin/basename $file)
done
# frontend JS
mkdir -p $out/public/js
2020-11-11 00:33:06 +00:00
ln -s ${frontend}/Main.js $out/public/js/elm.js
2020-11-07 17:29:47 +00:00
# static files
cp -vrf ${./static}/* $out/public
# migrations
ln -s ${./backend/migrations} $out/migrations
'';
}