diff --git a/pkgs/by-name/fe/feishin/package.nix b/pkgs/by-name/fe/feishin/package.nix index f8a1a7ee214c..ba20d7cc33bd 100644 --- a/pkgs/by-name/fe/feishin/package.nix +++ b/pkgs/by-name/fe/feishin/package.nix @@ -14,6 +14,7 @@ copyDesktopItems, makeDesktopItem, nix-update-script, + webVersion ? false, }: let pname = "feishin"; @@ -33,7 +34,10 @@ buildNpmPackage { inherit src; + __structuredAttrs = true; + npmConfigHook = pnpmConfigHook; + npmBuildScript = if webVersion then "build:web" else "build"; npmDeps = null; pnpmDeps = fetchPnpmDeps { @@ -52,8 +56,8 @@ buildNpmPackage { nativeBuildInputs = [ pnpm_10 ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ copyDesktopItems ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ++ lib.optionals (stdenv.hostPlatform.isLinux && !webVersion) [ copyDesktopItems ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && !webVersion) [ darwin.autoSignDarwinBinariesHook actool ]; @@ -73,7 +77,7 @@ buildNpmPackage { ln -s ${dart-sass}/bin/dart-sass "$dir"/sass ''; - postBuild = '' + postBuild = lib.optionalString (!webVersion) '' cp -r ${electron.dist} electron-dist chmod -R u+w electron-dist @@ -88,14 +92,18 @@ buildNpmPackage { installPhase = '' runHook preInstall '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' + + lib.optionalString webVersion '' + mkdir -p $out + cp -r out/web/* $out + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && !webVersion) '' mkdir -p $out/{Applications,bin} cp -r dist/**/Feishin.app $out/Applications/ makeWrapper $out/Applications/Feishin.app/Contents/MacOS/Feishin $out/bin/feishin \ --prefix PATH : "${lib.makeBinPath [ mpv-unwrapped ]}" \ --set DISABLE_AUTO_UPDATES 1 '' - + lib.optionalString stdenv.hostPlatform.isLinux '' + + lib.optionalString (stdenv.hostPlatform.isLinux && !webVersion) '' mkdir -p $out/share/feishin pushd dist/*-unpacked/ @@ -126,7 +134,7 @@ buildNpmPackage { runHook postInstall ''; - desktopItems = [ + desktopItems = lib.optionals (!webVersion) [ (makeDesktopItem { name = "feishin"; desktopName = "Feishin"; @@ -152,11 +160,11 @@ buildNpmPackage { sourceProvenance = with lib.sourceTypes; [ fromSource ]; license = lib.licenses.gpl3Plus; platforms = lib.platforms.unix; - mainProgram = "feishin"; maintainers = with lib.maintainers; [ BatteredBunny onny jlbribeiro ]; - }; + } + // lib.optionalAttrs (!webVersion) { mainProgram = "feishin"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d0e90d3fff8a..127f7085f840 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11694,4 +11694,6 @@ with pkgs; gpac-unstable = callPackage ../by-name/gp/gpac/package.nix { releaseChannel = "unstable"; }; + + feishin-web = feishin.override { webVersion = true; }; }