From e67d68a05d45e8c853299057439268dda8e81ca4 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Wed, 13 Jul 2022 20:47:15 +0200 Subject: [PATCH] anki: Use anki-bin This also removes ankisyncd, which in its current version in nixpkgs does not support the latest anki version. --- machines/renge/configuration.nix | 1 - machines/renge/services/ankisyncd.nix | 17 ----------------- users/simon/modules/anki/ankisyncd-plugin.py | 13 ------------- users/simon/modules/anki/default.nix | 6 ++++-- 4 files changed, 4 insertions(+), 33 deletions(-) delete mode 100644 machines/renge/services/ankisyncd.nix delete mode 100644 users/simon/modules/anki/ankisyncd-plugin.py diff --git a/machines/renge/configuration.nix b/machines/renge/configuration.nix index 4538c8e..2347824 100644 --- a/machines/renge/configuration.nix +++ b/machines/renge/configuration.nix @@ -5,7 +5,6 @@ ./hardware-configuration.nix ../../modules - ./services/ankisyncd.nix ./services/bang-evaluator.nix ./services/buchborgen.nix ./services/coturn.nix diff --git a/machines/renge/services/ankisyncd.nix b/machines/renge/services/ankisyncd.nix deleted file mode 100644 index 5072729..0000000 --- a/machines/renge/services/ankisyncd.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, ... }: -let - cfg = config.services.ankisyncd; -in -{ - services.ankisyncd = { - enable = true; - host = "127.0.0.1"; - }; - - services.nginx.virtualHosts."anki.sbruder.de" = { - enableACME = true; - forceSSL = true; - - locations."/".proxyPass = "http://${cfg.host}:${toString cfg.port}"; - }; -} diff --git a/users/simon/modules/anki/ankisyncd-plugin.py b/users/simon/modules/anki/ankisyncd-plugin.py deleted file mode 100644 index c59c60c..0000000 --- a/users/simon/modules/anki/ankisyncd-plugin.py +++ /dev/null @@ -1,13 +0,0 @@ -import anki.sync -import anki.hooks -import aqt - -anki.sync.SYNC_BASE = "https://anki.sbruder.de/%s" -anki.sync.SYNC_MEDIA_BASE = "https://anki.sbruder.de/msync%s" - - -def resetHostNum(): - aqt.mw.pm.profile["hostNum"] = None - - -anki.hooks.addHook("profileLoaded", resetHostNum) diff --git a/users/simon/modules/anki/default.nix b/users/simon/modules/anki/default.nix index b8a5ab4..e58e730 100644 --- a/users/simon/modules/anki/default.nix +++ b/users/simon/modules/anki/default.nix @@ -2,8 +2,10 @@ lib.mkIf nixosConfig.sbruder.gui.enable { home.packages = [ - pkgs.anki + pkgs.anki-bin ]; - home.file.".local/share/Anki2/addons21/ankisyncd/__init__.py".source = ./ankisyncd-plugin.py; + home.sessionVariables = { + ANKI_WAYLAND = 1; + }; }