add obsidian

This commit is contained in:
dusk 2022-08-15 01:58:35 +03:00
parent bea6650f00
commit 8f26fcbad5
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA
7 changed files with 15 additions and 393 deletions

View File

@ -1,208 +0,0 @@
final: prev: rec {
discord-system-electron =
prev.callPackage
mkDiscord
rec {
pname = "discord";
version = "0.0.17";
binaryName = "Discord";
desktopName = "Discord";
src =
prev.fetchurl
{
url = "https://dl.discordapp.net/apps/linux/${version}/discord-${version}.tar.gz";
sha256 = "sha256-NGJzLl1dm7dfkB98pQR3gv4vlldrII6lOMWTuioDExU=";
};
isWayland = true;
enableVulkan = false;
extraOptions = [
"--ignore-gpu-blocklist"
"--enable-gpu-rasterization"
"--enable-zero-copy"
"--disable-gpu-driver-bug-workarounds"
];
electron = prev.electron_15;
};
mkDiscord = {
pname,
version,
src,
binaryName,
desktopName,
isWayland ? false,
enableVulkan ? false,
extraOptions ? [],
autoPatchelfHook,
makeDesktopItem,
lib,
stdenv,
wrapGAppsHook,
alsaLib,
at-spi2-atk,
at-spi2-core,
atk,
cairo,
cups,
dbus,
electron,
expat,
fontconfig,
freetype,
gdk-pixbuf,
glib,
gtk3,
libcxx,
libdrm,
libnotify,
libpulseaudio,
libuuid,
libX11,
libXScrnSaver,
libXcomposite,
libXcursor,
libXdamage,
libXext,
libXfixes,
libXi,
libXrandr,
libXrender,
libXtst,
libxcb,
mesa,
nspr,
nss,
pango,
systemd,
libappindicator-gtk3,
libdbusmenu,
nodePackages,
vulkan-loader,
vulkan-extension-layer,
libGL,
pipewire,
}:
stdenv.mkDerivation
rec {
inherit pname version src;
nativeBuildInputs = [
nodePackages.asar
alsaLib
autoPatchelfHook
cups
libdrm
libuuid
libXdamage
libX11
libXScrnSaver
libXtst
libxcb
mesa.drivers
nss
wrapGAppsHook
];
dontWrapGApps = true;
libPath =
lib.makeLibraryPath
[
libcxx
systemd
libpulseaudio
stdenv.cc.cc
alsaLib
atk
at-spi2-atk
at-spi2-core
cairo
cups
dbus
expat
fontconfig
freetype
gdk-pixbuf
glib
gtk3
libnotify
libX11
libXcomposite
libuuid
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXtst
nspr
nss
libxcb
pango
systemd
libXScrnSaver
libappindicator-gtk3
libdbusmenu
vulkan-loader
vulkan-extension-layer
libGL
pipewire
];
flags =
(
lib.optionals
isWayland
[
"--flag-switches-begin"
"--enable-features=UseOzonePlatform,WebRTCPipeWireCapturer${
lib.optionalString enableVulkan ",Vulkan"
}"
"--flag-switches-end"
"--ozone-platform=wayland"
"--enable-webrtc-pipewire-capturer"
]
)
++ extraOptions;
installPhase = ''
mkdir -p $out/{bin,usr/lib/${pname},share/pixmaps}
ln -s discord.png $out/share/pixmaps/${pname}.png
ln -s "${desktopItem}/share/applications" $out/share/
# HACKS FOR SYSTEM ELECTRON
asar e resources/app.asar resources/app
rm resources/app.asar
sed -i "s|process.resourcesPath|'$out/usr/lib/${pname}'|" resources/app/app_bootstrap/buildInfo.js
sed -i "s|exeDir,|'$out/share/pixmaps',|" resources/app/app_bootstrap/autoStart/linux.js
asar p resources/app resources/app.asar --unpack-dir '**'
rm -rf resources/app
# Copy Relevanat data
cp -r resources/* $out/usr/lib/${pname}/
# Create starter script for discord
echo "#!${stdenv.shell}" > $out/bin/${pname}
echo "exec ${electron}/bin/electron ${lib.concatStringsSep " " flags} $out/usr/lib/${pname}/app.asar \$@" >> $out/bin/${pname}
chmod 755 $out/bin/${pname}
wrapProgram $out/bin/${pname} \
"''${gappsWrapperArgs[@]}" \
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
--prefix LD_LIBRARY_PATH : ${libPath}
'';
desktopItem =
makeDesktopItem
{
name = pname;
exec = pname;
icon = pname;
inherit desktopName;
genericName = meta.description;
categories = ["Network" "InstantMessaging"];
mimeTypes = ["x-scheme-handler/discord"];
};
meta = with lib; {
description = "All-in-one cross-platform voice and text chat for gamers";
homepage = "https://discordapp.com/";
downloadPage = "https://discordapp.com/download";
platforms = ["x86_64-linux"];
};
};
}

View File

@ -0,0 +1,12 @@
final: prev: {
obsidian = prev.obsidian.overrideAttrs (old: {
installPhase =
prev.lib.replaceStrings
["makeWrapper ${final.electron_17}/bin/electron $out/bin/obsidian"]
[
''makeWrapper ${final.electron_20}/bin/electron $out/bin/obsidian \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}"''
]
old.installPhase;
});
}

View File

@ -1,11 +1,9 @@
pkgs: ( pkgs: (
pkgs.lib.getAttrs pkgs.lib.getAttrs
[ [
"discord-system-electron"
"fractal-next" "fractal-next"
"gamescope" "obsidian"
"gaudible" "comic-mono"
"abaddon"
] ]
pkgs pkgs
) )

View File

@ -1,42 +0,0 @@
{
stdenv,
fetchFromGitHub,
gtkmm3,
sqlite,
openssl,
curlWithGnuTls,
nlohmann_json,
pkg-config,
cmake,
...
}:
stdenv.mkDerivation rec {
pname = "abaddon";
version = "ccf5afbba959068f34897b75afcd25c65c96d79c";
src = fetchFromGitHub {
owner = "uowuo";
repo = pname;
rev = version;
sha256 = "sha256-PKEly2yBM6UKNi/XEEUvbpTmvNSNJM1lUVMovCHgi50=";
fetchSubmodules = true;
};
nativeBuildInputs = [
pkg-config
cmake
];
buildInputs = [
gtkmm3.dev
curlWithGnuTls.dev
sqlite.dev
openssl
nlohmann_json
];
configurePhase = "mkdir build && cd build && cmake ..";
installPhase = "mkdir -p $out/bin && mv abaddon $out/bin/abaddon";
doCheck = false;
}

View File

@ -1,104 +0,0 @@
{
lib,
stdenv,
fetchFromGitHub,
meson,
pkgconfig,
libdrm,
xorg,
wayland,
wayland-protocols,
libxkbcommon,
libcap,
SDL2,
mesa,
libinput,
pixman,
xcbutilerrors,
xcbutilwm,
glslang,
ninja,
makeWrapper,
xwayland,
libuuid,
xcbutilrenderutil,
pipewire,
stb,
writeText,
wlroots,
vulkan-loader,
vulkan-headers,
libseat,
...
}: let
stbpc = writeText "stbpc" ''
prefix=${stb}
includedir=''${prefix}/include/stb
Cflags: -I''${includedir}
Name: stb
Version: ${stb.version}
Description: stb
'';
stb_ = stb.overrideAttrs (oldAttrs: rec {
installPhase = ''
${oldAttrs.installPhase}
install -Dm644 ${stbpc} $out/lib/pkgconfig/stb.pc
'';
});
in
stdenv.mkDerivation rec {
pname = "gamescope";
version = "3.11.30";
src = fetchFromGitHub {
owner = "Plagman";
repo = "gamescope";
rev = version;
sha256 = "sha256-dSQrOlQfUZkA8Vrc/Tj9dAWIIBOeb+tAen21fZe3Gto=";
fetchSubmodules = true;
};
postInstall = ''
wrapProgram $out/bin/gamescope \
--prefix PATH : "${lib.makeBinPath [xwayland]}"
'';
buildInputs = with xorg; [
libX11
libXdamage
libXcomposite
libXrender
libXext
libXxf86vm
libXtst
libdrm
vulkan-loader
wayland
wayland-protocols
libxkbcommon
libcap
SDL2
mesa
libinput
pixman
xcbutilerrors
xcbutilwm
libXi
libXres
libuuid
xcbutilrenderutil
xwayland
pipewire
wlroots
libseat
];
nativeBuildInputs = [meson pkgconfig glslang ninja makeWrapper stb_];
meta = with lib; {
description = "The micro-compositor formerly known as steamcompmgr";
license = licenses.bsd2;
homepage = src.meta.homepage;
platforms = platforms.linux;
maintainers = with maintainers; [];
};
}

View File

@ -1,34 +0,0 @@
{
python3,
python3Packages,
pulseaudio,
stdenv,
...
}:
stdenv.mkDerivation {
pname = "gaudible";
version = "master";
src = builtins.fetchGit {
url = "https://github.com/dbazile/gaudible.git";
rev = "ccd4ac14589f061c60217fe22120db8786898e4b";
ref = "refs/heads/master";
shallow = true;
};
buildInputs = [
python3Packages.pygobject3
python3Packages.dbus-python
];
installPhase = ''
mkdir -p $out/bin
chmod +x gaudible.py
cp gaudible.py $out/bin/gaudible
'';
fixupPhase = ''
substituteInPlace $out/bin/gaudible \
--replace "/usr/bin/paplay" "${pulseaudio}/bin/paplay" \
--replace "/bin/env python3" "${python3}/bin/python"
'';
}

View File

@ -172,7 +172,7 @@ in {
cloudflared cloudflared
lutris lutris
protontricks protontricks
inputs.fufexan.packages.${system}.gamescope obsidian
]; ];
}; };
programs = { programs = {