Update flake

This commit is contained in:
Sicheng Pan 2025-10-24 10:24:57 -07:00
parent 97e696e37d
commit 5bd27a07da
Signed by: macronova
GPG key ID: CE969670FB4B4A56
2 changed files with 11 additions and 123 deletions

22
flake.lock generated
View file

@ -36,11 +36,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1760524057,
"narHash": "sha256-EVAqOteLBFmd7pKkb0+FIUyzTF61VKi7YmvP1tw4nEw=",
"lastModified": 1761114652,
"narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "544961dfcce86422ba200ed9a0b00dd4b1486ec5",
"rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c",
"type": "github"
},
"original": {
@ -66,11 +66,11 @@
"sweet-ambar-blue": {
"flake": false,
"locked": {
"lastModified": 1759874534,
"narHash": "sha256-aA/wuj7Oc+4fkOrL8Qj/kTF2NzZrZ3/rNAmYs9nFxpw=",
"lastModified": 1760648820,
"narHash": "sha256-c8VDpDzgwnl53frZ2mSEjUEdQwHT2Vyxu99SIzqfS2g=",
"ref": "Ambar-Blue",
"rev": "f2d784908d2737b40379c55c79e9b09f1c6e6b99",
"revCount": 344,
"rev": "4781ed7639d1adc31e9ed0b6ff1ff070e580a144",
"revCount": 346,
"type": "git",
"url": "https://github.com/EliverLara/Sweet"
},
@ -83,11 +83,11 @@
"sweet-ambar-blue-dark": {
"flake": false,
"locked": {
"lastModified": 1759874277,
"narHash": "sha256-rULe52jTuZ+SFUkPEq0r91LML1z6fcMuXI+SDxWh7xI=",
"lastModified": 1760648872,
"narHash": "sha256-H5dWbA7KADhVPHLQI+WRGekcaS2QTBPYwGBF/O+ZOqc=",
"ref": "Ambar-Blue-Dark",
"rev": "9f4378087326b6b594af7f61ea8a0ddea7f50056",
"revCount": 427,
"rev": "26b987cb86deec843d7b6bb4adda28a7d3946c8f",
"revCount": 428,
"type": "git",
"url": "https://github.com/EliverLara/Sweet"
},

View file

@ -1,112 +0,0 @@
{
name,
pkgs,
...
}: let
version = "0.21.2";
src = pkgs.fetchFromGitHub {
owner = "jeffvli";
repo = "feishin";
tag = "v${version}";
hash = "sha256-F5m0hsN1BLfiUcl2Go54bpFnN8ktn6Rqa/df1xxoCA4=";
};
in
with pkgs;
buildNpmPackage {
inherit src version;
pname = name;
npmConfigHook = pnpm.configHook;
npmDeps = null;
pnpmDeps = pnpm.fetchDeps {
inherit src version;
pname = name;
fetcherVersion = 2;
hash = "sha256-5jEXdQMZ6a0JuhjPS1eZOIGsIGQHd6nKPI02eeR35pg=";
};
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
nativeBuildInputs = [copyDesktopItems];
postPatch = ''
# release/app dependencies are installed on preConfigure
substituteInPlace package.json \
--replace-fail '"postinstall": "electron-builder install-app-deps",' ""
# Don't check for updates.
substituteInPlace src/main/index.ts \
--replace-fail "autoUpdater.checkForUpdatesAndNotify();" ""
# https://github.com/electron/electron/issues/31121
substituteInPlace src/main/index.ts \
--replace-fail "process.resourcesPath" "'$out/share/feishin/resources'"
'';
preBuild = ''
rm -r node_modules/.pnpm/sass-embedded-*
test -d node_modules/.pnpm/sass-embedded@*
dir="$(echo node_modules/.pnpm/sass-embedded@*)/node_modules/sass-embedded/dist/lib/src/vendor/dart-sass"
mkdir -p "$dir"
ln -s ${dart-sass}/bin/dart-sass "$dir"/sass
'';
postBuild = ''
npm exec electron-builder -- \
--dir \
-c.electronDist=${
if stdenv.hostPlatform.isDarwin
then "./"
else electron.dist
} \
-c.electronVersion=${electron.version} \
-c.npmRebuild=false
'';
installPhase =
''
runHook preInstall
mkdir -p $out/share/feishin
pushd dist/*-unpacked/
cp -r locales resources{,.pak} $out/share/feishin
popd
# Code relies on checking app.isPackaged, which returns false if the executable is electron.
# Set ELECTRON_FORCE_IS_PACKAGED=1.
# https://github.com/electron/electron/issues/35153#issuecomment-1202718531
makeWrapper ${lib.getExe electron} $out/bin/feishin \
--add-flags $out/share/feishin/resources/app.asar \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
--set ELECTRON_FORCE_IS_PACKAGED=1 \
--inherit-argv0
for size in 32 64 128 256 512 1024; do
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
ln -s \
$out/share/feishin/resources/assets/icons/"$size"x"$size".png \
$out/share/icons/hicolor/"$size"x"$size"/apps/feishin.png
done
''
+ ''
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "feishin";
desktopName = "Feishin";
comment = "Full-featured Subsonic/Jellyfin compatible desktop music player";
icon = "feishin";
exec = "feishin %u";
categories = [
"Audio"
"AudioVideo"
];
mimeTypes = ["x-scheme-handler/feishin"];
})
];
}