Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

programs.anki.enable

Whether to enable Anki.

Type: boolean

Default:

false

Example:

true

Declared by:

programs.anki.package

The anki package to use.

Type: package

Default:

pkgs.anki

Declared by:

programs.anki.addons

List of Anki add-on packages to install.

Type: list of package

Default:

[ ]

Example:

[
  # When the add-on is already available in nixpkgs
  pkgs.ankiAddons.anki-connect

  # When the add-on is not available in nixpkgs
  (pkgs.anki-utils.buildAnkiAddon (finalAttrs: {
    pname = "recolor";
    version = "3.1";
    src = pkgs.fetchFromGitHub {
      owner = "AnKing-VIP";
      repo = "AnkiRecolor";
      rev = finalAttrs.version;
      sparseCheckout = [ "src/addon" ];
      hash = "sha256-28DJq2l9DP8O6OsbNQCZ0pm4S6CQ3Yz0Vfvlj+iQw8Y=";
    };
    sourceRoot = "${finalAttrs.src.name}/src/addon";
  }))

  # When the add-on needs to be configured
  pkgs.ankiAddons.passfail2.withConfig {
    config = {
      again_button_name = "not quite";
      good_button_name = "excellent";
      toggle_names_textcolors = 1;
    };
    user_files = ./dir-to-be-merged-into-addon-user-files-dir;
  };
]

Declared by:

programs.anki.answerKeys

Overrides for choosing what keyboard shortcut activates each answer button. The Anki default will be used for ones without an override defined.

Type: list of (submodule)

Default:

[ ]

Example:

[
  {
    ease = 1;
    key = "left";
  }
  {
    ease = 2;
    key = "up";
  }
  {
    ease = 3;
    key = "right";
  }
  {
    ease = 4;
    key = "down";
  }
]

Declared by:

programs.anki.answerKeys.*.ease

Number associated with an answer button.

By default, 1 = Again, 2 = Hard, 3 = Good, and 4 = Easy.

Type: signed integer

Example:

3

Declared by:

programs.anki.answerKeys.*.key

Keyboard shortcut for this answer button. The shortcut should be in the string format used by https://doc.qt.io/qt-6/qkeysequence.html.

Type: string

Example:

"3"

Declared by:

programs.anki.hideBottomBar

Hide bottom bar during review.

Type: null or boolean

Default:

null

Example:

true

Declared by:

programs.anki.hideBottomBarMode

When to hide the bottom bar when hideBottomBar is enabled.

Type: null or one of “fullscreen”, “always”

Default:

null

Example:

"fullscreen"

Declared by:

programs.anki.hideTopBar

Hide top bar during review.

Type: null or boolean

Default:

null

Example:

true

Declared by:

programs.anki.hideTopBarMode

When to hide the top bar when hideTopBar is enabled.

Type: null or one of “fullscreen”, “always”

Default:

null

Example:

"fullscreen"

Declared by:

programs.anki.language

Display language. Should be an underscore separated language tag. See https://github.com/ankitects/anki/blob/main/pylib/anki/lang.py for supported tags.

Type: non-empty string

Default:

"en_US"

Example:

"ja_JP"

Declared by:

programs.anki.legacyImportExport

Use legacy (pre 2.1.55) import/export handling code.

Type: null or boolean

Default:

null

Declared by:

programs.anki.minimalistMode

Minimalist user interface mode.

Type: null or boolean

Default:

null

Example:

true

Declared by:

programs.anki.profiles

Anki profiles and their settings. Profiles are primarily intended to be one per person, and are not recommended for splitting up your own content.

Type: attribute set of (submodule)

Default:

{
  "User 1" = { };
}

Declared by:

programs.anki.profiles.<name>.default

Open this profile on startup.

Type: boolean

Default:

false

Declared by:

programs.anki.profiles.<name>.sync.autoSync

Automatically sync on profile open/close.

Type: null or boolean

Default:

null

Example:

true

Declared by:

programs.anki.profiles.<name>.sync.autoSyncMediaMinutes

Automatically sync media every X minutes. Set this to 0 to disable periodic media syncing.

Type: null or (unsigned integer, meaning >=0)

Default:

null

Example:

15

Declared by:

programs.anki.profiles.<name>.sync.keyFile

Path to a file containing the sync account sync key. This is different from the account password.

To get the sync key, follow these steps:

  • Enable this Home Manager module: programs.anki.enable = true
  • Open Anki.
  • Navigate to the sync settings page. (Tools > Preferences > Syncing)
  • Log in to your AnkiWeb account.
  • Select “Yes” to the prompt about saving preferences and syncing.
  • A Home Manager warning prompt will show. Select “Show details…”.
  • Get your sync key from the message: “syncKey changed from `None` to `<YOUR SYNC KEY WILL BE HERE>`”

Type: null or absolute path

Default:

null

Declared by:

programs.anki.profiles.<name>.sync.networkTimeout

Network timeout in seconds (clamped between 30 and 99999).

Type: null or (unsigned integer, meaning >=0)

Default:

null

Example:

60

Declared by:

programs.anki.profiles.<name>.sync.syncMedia

Synchronize audio and images too.

Type: null or boolean

Default:

null

Example:

true

Declared by:

programs.anki.profiles.<name>.sync.url

Custom sync server URL. See https://docs.ankiweb.net/sync-server.html.

Type: null or string

Default:

null

Example:

"http://example.com/anki-sync/"

Declared by:

programs.anki.profiles.<name>.sync.username

Sync account username.

Type: null or string

Default:

null

Example:

"lovelearning@email.com"

Declared by:

programs.anki.profiles.<name>.sync.usernameFile

Path to a file containing the sync account username.

Type: null or absolute path

Default:

null

Declared by:

programs.anki.reduceMotion

Disable various animations and transitions of the user interface.

Type: null or boolean

Default:

null

Example:

true

Declared by:

programs.anki.spacebarRatesCard

Spacebar (or enter) also answers card.

Type: null or boolean

Default:

null

Example:

true

Declared by:

programs.anki.style

Widgets style.

Type: null or one of “anki”, “native”

Default:

null

Example:

"native"

Declared by:

programs.anki.theme

Theme to use.

Type: null or one of “followSystem”, “light”, “dark”

Default:

null

Example:

"dark"

Declared by:

programs.anki.uiScale

User interface scale.

Type: null or integer or floating point number between 1.0 and 2.0 (both inclusive)

Default:

null

Example:

1.0

Declared by:

programs.anki.videoDriver

Video driver to use.

Type: null or one of “opengl”, “angle”, “software”, “metal”, “vulkan”, “d3d11”

Default:

null

Example:

"opengl"

Declared by: