blob: 2538937abb6dcb13ddb89fcbb17dbab355e054a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
{
lib,
stdenv,
appimageTools,
desktop-file-utils,
fetchurl,
}:
let
pname = "p3x-onenote";
onenote = lib.importJSON ./sources.json;
version = onenote.version;
plat =
{
aarch64-linux = "-arm64";
x86_64-linux = "";
}
.${stdenv.hostPlatform.system};
hash = onenote.hash.${stdenv.hostPlatform.system};
src = fetchurl {
url = "https://github.com/patrikx3/onenote/releases/download/v${version}/P3X-OneNote-${version}${plat}.AppImage";
inherit hash;
};
appimageContents = appimageTools.extract {
inherit pname version src;
};
in
appimageTools.wrapType2 {
inherit pname version src;
extraInstallCommands = ''
mkdir -p $out/share/licenses/p3x-onenote
install -D ${appimageContents}/p3x-onenote.png -t $out/share/icons/hicolor/512x512/apps/
cp ${appimageContents}/p3x-onenote.desktop $out
cp ${appimageContents}/LICENSE.electron.txt $out/share/licenses/p3x-onenote/LICENSE
${desktop-file-utils}/bin/desktop-file-install --dir $out/share/applications \
--set-key Comment --set-value "P3X OneNote Linux" \
--set-key Exec --set-value "p3x-onenote" \
--delete-original $out/p3x-onenote.desktop
'';
passthru.updateScript = ./update.sh;
meta = {
homepage = "https://github.com/patrikx3/onenote";
description = "Linux Electron Onenote - A Linux compatible version of OneNote";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ tiagolobocastro ];
platforms = [
"x86_64-linux"
"aarch64-linux"
];
mainProgram = "p3x-onenote";
};
}
|