mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-15 21:59:12 +02:00
wip: migrate client modules
This commit is contained in:
parent
f6d2ff1544
commit
7ce27d5d2f
245 changed files with 20254 additions and 188 deletions
66
modules-clone/home/common/anki.nix
Normal file
66
modules-clone/home/common/anki.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{ lib, config, pkgs, globals, confLib, type, ... }:
|
||||
let
|
||||
moduleName = "anki";
|
||||
inherit (config.swarselsystems) isPublic isNixos;
|
||||
in
|
||||
{
|
||||
options.swarselmodules.${moduleName} = lib.mkEnableOption "enable ${moduleName} and settings";
|
||||
config = lib.mkIf config.swarselmodules.${moduleName}
|
||||
({
|
||||
|
||||
programs.anki = {
|
||||
enable = true;
|
||||
package = pkgs.anki;
|
||||
hideBottomBar = true;
|
||||
hideBottomBarMode = "always";
|
||||
hideTopBar = true;
|
||||
hideTopBarMode = "always";
|
||||
reduceMotion = true;
|
||||
spacebarRatesCard = true;
|
||||
# videoDriver = "opengl";
|
||||
profiles."User 1".sync = {
|
||||
autoSync = false; # sync on profile close will delay system shutdown
|
||||
syncMedia = true;
|
||||
autoSyncMediaMinutes = 5;
|
||||
url = "https://${globals.services.ankisync.domain}";
|
||||
usernameFile = confLib.getConfig.sops.secrets.anki-user.path;
|
||||
# this is not the password but the syncKey
|
||||
# get it by logging in or out, saving preferences and then
|
||||
# show details on the "settings wont be saved" dialog
|
||||
keyFile = confLib.getConfig.sops.secrets.anki-pw.path;
|
||||
};
|
||||
addons =
|
||||
let
|
||||
minimize-to-tray = pkgs.anki-utils.buildAnkiAddon
|
||||
(finalAttrs: {
|
||||
pname = "minimize-to-tray";
|
||||
version = "2.0.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "simgunz";
|
||||
repo = "anki21-addons_minimize-to-tray";
|
||||
rev = finalAttrs.version;
|
||||
sparseCheckout = [ "src" ];
|
||||
hash = "sha256-xmvbIOfi9K0yEUtUNKtuvv2Vmqrkaa4Jie6J1s+FuqY=";
|
||||
};
|
||||
sourceRoot = "${finalAttrs.src.name}/src";
|
||||
});
|
||||
in
|
||||
[
|
||||
(minimize-to-tray.withConfig
|
||||
{
|
||||
config = {
|
||||
hide_on_startup = "true";
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
} // lib.optionalAttrs (type != "nixos") {
|
||||
sops = lib.mkIf (!isPublic && !isNixos) {
|
||||
secrets = {
|
||||
anki-user = { };
|
||||
anki-pw = { };
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue