-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathflake.nix
66 lines (63 loc) · 1.72 KB
/
flake.nix
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
62
63
64
65
66
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
utils,
}:
let
supportedSystems = [
"x86_64-darwin"
"x86_64-linux"
];
in
utils.lib.eachSystem supportedSystems (
system:
let
pkgs = import nixpkgs { inherit system; };
version = "0.0.0.6";
releasesUrl = "https://github.com/kamalsacranie/anki-panky/releases";
src =
if system == "x86_64-darwin" then
pkgs.fetchzip {
url = "${releasesUrl}/download/${version}/macOS-11-anki-panky-${version}.tar.gz";
sha256 = "7kkfdx1vndheb63+m2HOLXo0wOYX4iReh9c7Ps/KYQk=";
}
else
pkgs.fetchzip {
url = "${releasesUrl}/download/${version}/ubuntu-latest-anki-panky-${version}.tar.gz";
sha256 = "k5DQUI2JLVujkV2aZObAPn43m9QZ+aXPJwXpUKDuEDo=";
};
ankiPanky = pkgs.stdenv.mkDerivation {
name = "anki-panky";
inherit src version;
installPhase = ''
mkdir -p $out/bin
cp -R $src/anki-panky $out/bin/anki-panky
chmod +x $out/bin/anki-panky
'';
};
fonts = pkgs.nerdfonts.override { fonts = [ "Hasklig" ]; };
in
with pkgs;
{
devShells.default = mkShell {
nativeBuildInputs = [ fonts ];
buildInputs = [
ankiPanky
pandoc
tectonic
];
# Add necessary library dependencies
LD_LIBRARY_PATH = "${lib.makeLibraryPath [
gmp
zlib
]}";
};
}
);
}