{ stdenv , lib , mkYarnPackage , fetchgit , python2 , pkg-config , libsass , nodejs , yarn }: let srcData = builtins.fromJSON (builtins.readFile ./src-frontend.json); version = "unstable-" + builtins.head (lib.splitString "T" srcData.date); src = fetchgit { inherit (srcData) url rev sha256; }; frontend-modules = mkYarnPackage rec { name = "vikunja-frontend-modules"; inherit version src; doDist = false; }; in stdenv.mkDerivation { pname = "vikunja-desktop"; inherit version src; nativeBuildInputs = [ frontend-modules yarn ]; buildPhase = '' # Cannot use symlink or postcss-loader will crap out cp -r ${frontend-modules}/libexec/vikunja-frontend/node_modules/ . yarn --offline run build sed -i 's/\/api\/v1//g' dist/index.html ''; installPhase = '' cp -r dist $out ''; passthru = { inherit frontend-modules; }; meta = { description = "Desktop version of the Vikunja to-do list app"; homepage = "https://vikunja.io/"; license = lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ kolaente ]; platforms = lib.platforms.all; }; }