mirror of
https://git.sr.ht/~roxwize/.dotfiles
synced 2025-01-30 22:53:37 +00:00
~
Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
parent
1ca14c360e
commit
5d5f1b903e
1 changed files with 82 additions and 0 deletions
82
nixos/pkgs/ynodesktop/default.nix
Normal file
82
nixos/pkgs/ynodesktop/default.nix
Normal file
|
@ -0,0 +1,82 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchYarnDeps,
|
||||
yarnConfigHook,
|
||||
yarnBuildHook,
|
||||
yarnInstallHook,
|
||||
imagemagick,
|
||||
makeWrapper,
|
||||
nodejs,
|
||||
electron,
|
||||
makeDesktopItem
|
||||
}: stdenv.mkDerivation rec {
|
||||
pname = "ynodesktop";
|
||||
version = "1.2.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "affectioned";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "1zr84mbc5p27f6ks4z2rkgg9cifzimf478f42bmz4yp44vrhaj1a";
|
||||
};
|
||||
|
||||
yarnOfflineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/yarn.lock";
|
||||
hash = "sha256-EHoSypJWFC2k0ES6ZQxxrumBLx9H3E9YTniWf0V5nWc=";
|
||||
};
|
||||
|
||||
env.ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
|
||||
|
||||
nativeBuildInputs = [
|
||||
yarnConfigHook
|
||||
yarnBuildHook
|
||||
yarnInstallHook
|
||||
imagemagick
|
||||
makeWrapper
|
||||
nodejs
|
||||
];
|
||||
|
||||
yarnBuildScript = "electron-builder";
|
||||
yarnBuildFlags = [
|
||||
"--dir"
|
||||
"-c.electronDist=${electron.dist}"
|
||||
"-c.electronVersion=${electron.version}"
|
||||
];
|
||||
|
||||
# TODO: also export the other icons from the .ico (i dont think theyre scaled properly though)
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/share/icons/hicolor/256x256/apps
|
||||
magick "assets/logo.ico[5]" "$out/share/icons/hicolor/256x256/apps/ynodesktop.png"
|
||||
|
||||
mkdir -p $out/share/ynodesktop
|
||||
cp -r dist/*-unpacked/{locales,resources{,.pak}} $out/share/ynodesktop
|
||||
|
||||
makeWrapper "${electron}/bin/electron" $out/bin/ynodesktop \
|
||||
--add-flags $out/share/ynodesktop/resources/app.asar \
|
||||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
|
||||
--inherit-argv0
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
desktopItems = [(
|
||||
makeDesktopItem {
|
||||
name = pname;
|
||||
desktopName = "YNOdesktop";
|
||||
exec = "ynodesktop";
|
||||
icon = "ynodesktop";
|
||||
categories = [ "Game" ];
|
||||
}
|
||||
)];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A desktop client for Yume Nikki Online with Discord Rich Presence";
|
||||
homepage = "https://github.com/affectioned/ynodesktop";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue