packages: add whph
This commit is contained in:
parent
57ab783364
commit
e8334a04b2
6 changed files with 128 additions and 20 deletions
|
@ -124,8 +124,6 @@
|
||||||
"sd_mod"
|
"sd_mod"
|
||||||
];
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
|
|
||||||
# Support virtualization, thunderbolt, and poking the APCI directly. >.>
|
|
||||||
boot.kernelModules = [
|
boot.kernelModules = [
|
||||||
"thunderbolt"
|
"thunderbolt"
|
||||||
];
|
];
|
||||||
|
@ -133,6 +131,25 @@
|
||||||
# Support thunderbolt.
|
# Support thunderbolt.
|
||||||
services.hardware.bolt.enable = true;
|
services.hardware.bolt.enable = true;
|
||||||
|
|
||||||
|
# Support bluetooth.
|
||||||
|
hardware.bluetooth = {
|
||||||
|
enable = true;
|
||||||
|
powerOnBoot = false;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
General = {
|
||||||
|
|
||||||
|
# Support A2DP.
|
||||||
|
Enable = "Source,Sink,Media,Socket";
|
||||||
|
|
||||||
|
# Enable experimental featurees, like reading device battery levels.
|
||||||
|
Experimental = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-uuid/bb880b80-992f-4e56-bb80-c5c4df0ddd72";
|
device = "/dev/disk/by-uuid/bb880b80-992f-4e56-bb80-c5c4df0ddd72";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
|
|
|
@ -27,6 +27,7 @@ with pkgs;
|
||||||
gnused
|
gnused
|
||||||
gnugrep
|
gnugrep
|
||||||
just
|
just
|
||||||
|
qrencode
|
||||||
|
|
||||||
# Backup things.
|
# Backup things.
|
||||||
keepassxc
|
keepassxc
|
||||||
|
|
|
@ -105,6 +105,7 @@ with pkgs;
|
||||||
obsidian
|
obsidian
|
||||||
onboard
|
onboard
|
||||||
supersonic
|
supersonic
|
||||||
|
deprekages.whph
|
||||||
|
|
||||||
# Development.
|
# Development.
|
||||||
jetbrains-toolbox
|
jetbrains-toolbox
|
||||||
|
|
|
@ -45,6 +45,7 @@ flake-utils.lib.eachDefaultSystem (
|
||||||
hrvst-cli = callPackage ./hrvst-cli { };
|
hrvst-cli = callPackage ./hrvst-cli { };
|
||||||
notion-app = callPackage ./notion-app { inherit _7zz; };
|
notion-app = callPackage ./notion-app { inherit _7zz; };
|
||||||
gfn-electron = callPackage ./geforce-now { };
|
gfn-electron = callPackage ./geforce-now { };
|
||||||
|
whph = callPackage ./whph.nix { };
|
||||||
|
|
||||||
# utilities
|
# utilities
|
||||||
ykush = callPackage ./ykush.nix { };
|
ykush = callPackage ./ykush.nix { };
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
asar,
|
asar,
|
||||||
writeScriptBin,
|
writeScriptBin,
|
||||||
bash,
|
bash,
|
||||||
libgcc
|
libgcc,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
better-sqlite3-version = "11.4.0";
|
better-sqlite3-version = "11.4.0";
|
||||||
|
@ -38,30 +38,30 @@ let
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
ls -lah **/*
|
ls -lah **/*
|
||||||
|
|
||||||
asar e "Notion/Notion.app/Contents/Resources/app.asar" asar_patched
|
asar e "Notion/Notion.app/Contents/Resources/app.asar" asar_patched
|
||||||
|
|
||||||
# replace the native dependencies with linux versions
|
# replace the native dependencies with linux versions
|
||||||
cp "$betterSqlite3/Release/better_sqlite3.node" "asar_patched/node_modules/better-sqlite3/build/Release/"
|
cp "$betterSqlite3/Release/better_sqlite3.node" "asar_patched/node_modules/better-sqlite3/build/Release/"
|
||||||
|
|
||||||
# fully disabling auto updates
|
# fully disabling auto updates
|
||||||
sed -i 's/if("darwin"===process.platform){const e=s.systemPreferences?.getUserDefault(E,"boolean"),t=_.Store.getState().app.preferences?.isAutoUpdaterDisabled;return Boolean(e||t)}return!1/return!0/g' "asar_patched/.webpack/main/index.js"
|
sed -i 's/if("darwin"===process.platform){const e=s.systemPreferences?.getUserDefault(E,"boolean"),t=_.Store.getState().app.preferences?.isAutoUpdaterDisabled;return Boolean(e||t)}return!1/return!0/g' "asar_patched/.webpack/main/index.js"
|
||||||
|
|
||||||
# fix tray icon and right click menu
|
# fix tray icon and right click menu
|
||||||
mkdir -p asar_patched/.webpack/main
|
mkdir -p asar_patched/.webpack/main
|
||||||
cp ${./notion.png} asar_patched/.webpack/main/trayIcon.png
|
cp ${./notion.png} asar_patched/.webpack/main/trayIcon.png
|
||||||
sed -i 's|this.tray.on("click",(()=>{this.onClick()}))|this.tray.setContextMenu(this.trayMenu),this.tray.on("click",(()=>{this.onClick()}))|g' "asar_patched/.webpack/main/index.js"
|
sed -i 's|this.tray.on("click",(()=>{this.onClick()}))|this.tray.setContextMenu(this.trayMenu),this.tray.on("click",(()=>{this.onClick()}))|g' "asar_patched/.webpack/main/index.js"
|
||||||
sed -i 's|getIcon(){[^}]*}|getIcon(){return s.default.join(__dirname, "trayIcon.png");}|g' "asar_patched/.webpack/main/index.js"
|
sed -i 's|getIcon(){[^}]*}|getIcon(){return s.default.join(__dirname, "trayIcon.png");}|g' "asar_patched/.webpack/main/index.js"
|
||||||
|
|
||||||
# avoid running duplicated instances, fixes url opening
|
# avoid running duplicated instances, fixes url opening
|
||||||
sed -i 's|o.app.on("open-url",w.handleOpenUrl)):"win32"===process.platform|o.app.on("open-url",w.handleOpenUrl)):"linux"===process.platform|g' "asar_patched/.webpack/main/index.js"
|
sed -i 's|o.app.on("open-url",w.handleOpenUrl)):"win32"===process.platform|o.app.on("open-url",w.handleOpenUrl)):"linux"===process.platform|g' "asar_patched/.webpack/main/index.js"
|
||||||
|
|
||||||
# fake the useragent as windows to fix the spellchecker languages selector and other issues
|
# fake the useragent as windows to fix the spellchecker languages selector and other issues
|
||||||
sed -i 's|e.setUserAgent(`''${e.getUserAgent()} WantsServiceWorker`),|e.setUserAgent(`''${e.getUserAgent().replace("Linux", "Windows")} WantsServiceWorker`),|g' "asar_patched/.webpack/main/index.js"
|
sed -i 's|e.setUserAgent(`''${e.getUserAgent()} WantsServiceWorker`),|e.setUserAgent(`''${e.getUserAgent().replace("Linux", "Windows")} WantsServiceWorker`),|g' "asar_patched/.webpack/main/index.js"
|
||||||
|
|
||||||
# re-pack the asar
|
# re-pack the asar
|
||||||
asar p asar_patched app.asar --unpack "*.node"
|
asar p asar_patched app.asar --unpack "*.node"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
|
88
packages/whph.nix
Normal file
88
packages/whph.nix
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
fetchzip,
|
||||||
|
autoPatchelfHook,
|
||||||
|
xorg,
|
||||||
|
gtk3,
|
||||||
|
zlib,
|
||||||
|
pango,
|
||||||
|
cairo,
|
||||||
|
harfbuzz,
|
||||||
|
at-spi2-atk,
|
||||||
|
gdk-pixbuf,
|
||||||
|
glib,
|
||||||
|
gst_all_1,
|
||||||
|
libayatana-appindicator,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
this = stdenv.mkDerivation {
|
||||||
|
pname = "whph";
|
||||||
|
version = "0.10.1";
|
||||||
|
|
||||||
|
src = fetchzip {
|
||||||
|
url = "https://github.com/ahmet-cetinkaya/whph/releases/download/v${this.version}/whph-v${this.version}-linux.tar.gz";
|
||||||
|
hash = "sha256-RnxeqZBS7U65Dz0gc/uMDMnWU3tDN/Jx3Czs1gn0rJk=";
|
||||||
|
|
||||||
|
stripRoot = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
autoPatchelfHook
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
xorg.libSM
|
||||||
|
xorg.libICE
|
||||||
|
xorg.libX11
|
||||||
|
xorg.libXext
|
||||||
|
gtk3
|
||||||
|
zlib
|
||||||
|
pango
|
||||||
|
cairo
|
||||||
|
harfbuzz
|
||||||
|
at-spi2-atk
|
||||||
|
gdk-pixbuf
|
||||||
|
glib
|
||||||
|
gst_all_1.gst-plugins-base
|
||||||
|
libayatana-appindicator
|
||||||
|
];
|
||||||
|
|
||||||
|
desktopFile = ''
|
||||||
|
[Desktop Entry]
|
||||||
|
Version=1.0
|
||||||
|
Type=Application
|
||||||
|
Name=WHPH
|
||||||
|
GenericName=Work Hard Play Hard; Task Manager
|
||||||
|
Comment=manager for tasks, habits, and screen use in one
|
||||||
|
Exec=${placeholder "out"}/bin/whph %U
|
||||||
|
Icon=${placeholder "out"}/opt/${this.pname}/share/icons/hicolor/512x512/apps/whph.png
|
||||||
|
Categories=Office;ProjectManagement;
|
||||||
|
MimeType=x-scheme-handler/notion;
|
||||||
|
StartupNotify=false
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
mkdir -p $out/opt/${this.pname}
|
||||||
|
|
||||||
|
cp -r $src/* $out/opt/${this.pname}/
|
||||||
|
addAutoPatchelfSearchPath ${this.src}/lib/
|
||||||
|
|
||||||
|
# Launch wrapper.
|
||||||
|
echo "#!/bin/sh" >> $out/bin/whph
|
||||||
|
echo "$out/opt/${this.pname}/whph \$@" >> $out/bin/whph
|
||||||
|
chmod +x $out/bin/whph
|
||||||
|
|
||||||
|
# Application menu entry.
|
||||||
|
mkdir -p $out/share/applications
|
||||||
|
echo "$desktopFile" > $out/share/applications/whph.desktop
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
};
|
||||||
|
in
|
||||||
|
this
|
Loading…
Add table
Reference in a new issue