Skip to content

Commit f6dfc6c

Browse files
committed
Add flake.nix for development dependencies
1 parent fbba756 commit f6dfc6c

File tree

2 files changed

+117
-0
lines changed

2 files changed

+117
-0
lines changed

flake.lock

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
description = ''
3+
Anki add-on for multiple answers in "type in the answer" cards
4+
'';
5+
6+
inputs = {
7+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
8+
};
9+
10+
outputs =
11+
{
12+
self,
13+
nixpkgs,
14+
flake-utils,
15+
}:
16+
flake-utils.lib.eachDefaultSystem (
17+
system:
18+
let
19+
pkgs = nixpkgs.legacyPackages.${system};
20+
21+
pythonWithPackages = pkgs.python311.withPackages (
22+
python-pkgs: with python-pkgs; [
23+
mypy
24+
pytest
25+
pytest-cov
26+
]
27+
);
28+
29+
packages = with pkgs; [
30+
anki
31+
pythonWithPackages
32+
ruff
33+
zip
34+
];
35+
in
36+
{
37+
packages.default = pkgs.stdenv.mkDerivation {
38+
pname = "answerset";
39+
version = self.shortRev or "dirty";
40+
src = self;
41+
nativeBuildInputs = packages;
42+
doCheck = true;
43+
checkTarget = "test";
44+
installPhase = ''
45+
mkdir $out
46+
cp answerset.ankiaddon $out
47+
'';
48+
};
49+
50+
checks.default = self.packages.${system}.default;
51+
52+
devShells.default = pkgs.mkShell { inherit packages; };
53+
54+
formatter = pkgs.nixfmt-rfc-style;
55+
}
56+
);
57+
}

0 commit comments

Comments
 (0)