Skip to content

Commit d767424

Browse files
committed
Pretix: add pretix-dbvat plugin
Also overriding pretix tests until we can update. nixpkgs PR for the plugin is pending.
1 parent db95348 commit d767424

4 files changed

Lines changed: 62 additions & 8 deletions

File tree

hosts/goldberg/configuration.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
./hardware-config.nix
99
../../services/mumble.nix
1010
../../services/website.nix
11-
../../services/matrix
12-
../../services/vaultwarden.nix
13-
../../services/dokuwiki.nix
14-
../../services/freescout.nix
15-
../../services/hedgedoc.nix
11+
#../../services/matrix
12+
#../../services/vaultwarden.nix
13+
#../../services/dokuwiki.nix
14+
#../../services/freescout.nix
15+
#../../services/hedgedoc.nix
1616
../../services/pretix.nix
17-
../../services/pretalx.nix
18-
../../services/monitoring/server
17+
#../../services/pretalx.nix
18+
#../../services/monitoring/server
1919
];
2020

2121
system.stateVersion = "23.05";

packages/default.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,15 @@ final: prev:
185185
})];
186186

187187
matrixjoinlink = final.callPackage ./matrixjoinlink {};
188+
189+
pretix = prev.pretix.overrideAttrs (oa: {
190+
# Tests have been fixed in http://github.com/pretix/pretix/commit/5a5a551c21461d9ef36337480c9874d65a9fdba9
191+
# but because we can't update currently, doing that manually.
192+
disabledTests = (oa.disabledTests or []) ++ [
193+
"test_english_no_region_set"
194+
"test_english_region_US"
195+
"test_german_region_US"
196+
];
197+
});
198+
pretix-dbvat = final.pretix.passthru.python.pkgs.callPackage ./pretix-dbvat.nix {};
188199
}

packages/pretix-dbvat.nix

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchFromGitHub,
5+
pretix-plugin-build,
6+
setuptools,
7+
}:
8+
9+
buildPythonPackage rec {
10+
pname = "pretix-dbvat";
11+
version = "1.1.0";
12+
pyproject = true;
13+
14+
src = fetchFromGitHub {
15+
owner = "pretix";
16+
repo = "pretix-dbvat";
17+
rev = "v${version}";
18+
hash = "sha256-yAKqB0G2WyGqGogAxv8fI34gO6Wl/50sY/5rvWYH4Ho=";
19+
};
20+
21+
build-system = [
22+
pretix-plugin-build
23+
setuptools
24+
];
25+
26+
doCheck = false; # no tests
27+
28+
pythonImportsCheck = [
29+
"pretix_dbvat"
30+
];
31+
32+
meta = with lib; {
33+
description = "Plugin for using Deutsche Bahn (DB) Event Discount (Veranstaltungsrabatt)";
34+
homepage = "https://github.com/pretix/pretix-dbvat";
35+
license = licenses.asl20;
36+
maintainers = with maintainers; [ e1mo ];
37+
};
38+
}

services/pretix.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
, isDev
33
, config
44
, lib
5+
, pkgs
56
, ... }:
67

78
let
@@ -18,7 +19,7 @@ in {
1819
url = "https://${domain}";
1920
currency = "EUR";
2021
loglevel = if isDev then "INFO" else "WARNING";
21-
plugins_default = "pretix.plugins.sendmail,pretix.plugins.statistics,pretix.plugins.ticketoutputpdf";
22+
plugins_default = "pretix.plugins.sendmail,pretix.plugins.statistics,pretix.plugins.ticketoutputpdf,pretix.plugins.dbvat";
2223
plugins_exclude = "pretix.plugins.paypal,pretix.plugins.paypal2,pretix.plugins.stripe,pretix.plugins.banktransfer";
2324
audit_comments = true;
2425
obligatory_2fa = true;
@@ -54,6 +55,10 @@ in {
5455
};
5556
};
5657

58+
plugins = [
59+
pkgs.pretix-dbvat
60+
];
61+
5762
database.createLocally = true;
5863
nginx = {
5964
inherit domain;

0 commit comments

Comments
 (0)