mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
The account password is different from the sync key needed here. Add instructions for how to get the sync key, and make the option name accurate.
58 lines
1.3 KiB
Nix
58 lines
1.3 KiB
Nix
{ pkgs, ... }:
|
|
let
|
|
# This would normally not be a file in the store for security reasons.
|
|
testKeyFile = pkgs.writeText "test-key-file" "a-sync-key";
|
|
in
|
|
{
|
|
programs.anki = {
|
|
enable = true;
|
|
addons = [ pkgs.ankiAddons.passfail2 ];
|
|
answerKeys = [
|
|
{
|
|
ease = 1;
|
|
key = "left";
|
|
}
|
|
{
|
|
ease = 2;
|
|
key = "up";
|
|
}
|
|
];
|
|
hideBottomBar = true;
|
|
hideBottomBarMode = "fullscreen";
|
|
hideTopBar = false;
|
|
hideTopBarMode = "always";
|
|
language = "en_US";
|
|
legacyImportExport = false;
|
|
minimalistMode = true;
|
|
reduceMotion = true;
|
|
spacebarRatesCard = true;
|
|
style = "native";
|
|
theme = "dark";
|
|
uiScale = 1.0;
|
|
videoDriver = "opengl";
|
|
sync = {
|
|
autoSync = true;
|
|
syncMedia = true;
|
|
autoSyncMediaMinutes = 15;
|
|
networkTimeout = 60;
|
|
url = "http://example.com/anki-sync/";
|
|
username = "lovelearning@email.com";
|
|
keyFile = testKeyFile;
|
|
};
|
|
};
|
|
|
|
nmt.script =
|
|
let
|
|
ankiBaseDir =
|
|
if pkgs.stdenv.hostPlatform.isDarwin then
|
|
"home-files/Library/Application Support/Anki2"
|
|
else
|
|
"home-files/.local/share/Anki2";
|
|
in
|
|
''
|
|
assertFileExists "${ankiBaseDir}/prefs21.db"
|
|
|
|
assertFileExists "${ankiBaseDir}/gldriver6"
|
|
'';
|
|
}
|