about summary refs log tree commit diff stats
path: root/modules/home.legacy/conf
diff options
context:
space:
mode:
Diffstat (limited to 'modules/home.legacy/conf')
-rw-r--r--modules/home.legacy/conf/default.nix1
-rw-r--r--modules/home.legacy/conf/firefox/config/bookmarks/default.nix22
-rw-r--r--modules/home.legacy/conf/firefox/config/search/engines/default.nix6
-rw-r--r--modules/home.legacy/conf/mail/default.nix32
-rw-r--r--modules/home.legacy/conf/mbsync/default.nix17
-rw-r--r--modules/home.legacy/conf/mpv/default.nix10
6 files changed, 47 insertions, 41 deletions
diff --git a/modules/home.legacy/conf/default.nix b/modules/home.legacy/conf/default.nix
index 848bcccf..e1cab572 100644
--- a/modules/home.legacy/conf/default.nix
+++ b/modules/home.legacy/conf/default.nix
@@ -16,7 +16,6 @@
     ./mail
     ./mako
     ./mbsync
-    ./mpv
     ./mumble
     ./neomutt
     ./nix-index
diff --git a/modules/home.legacy/conf/firefox/config/bookmarks/default.nix b/modules/home.legacy/conf/firefox/config/bookmarks/default.nix
index c612bf4d..41936819 100644
--- a/modules/home.legacy/conf/firefox/config/bookmarks/default.nix
+++ b/modules/home.legacy/conf/firefox/config/bookmarks/default.nix
@@ -3,27 +3,7 @@
   pkgs,
   ...
 }: let
-  bookmarks = [
-    {
-      name = "Feed - Piped";
-      url = "https://piped.video/feed";
-    }
-
-    {
-      name = "DeepL Translate";
-      url = "https://www.deepl.com/translator";
-    }
-
-    {
-      name = "Nix lib";
-      url = "https://teu5us.github.io/nix-lib.html";
-    }
-
-    {
-      name = "Nixpkgs manual";
-      url = "https://ryantm.github.io/nixpkgs/";
-    }
-  ];
+  bookmarks = [];
 
   mkBookmarksFile = (import ./lib.nix) {inherit lib pkgs;};
   bookmarks_file = mkBookmarksFile bookmarks;
diff --git a/modules/home.legacy/conf/firefox/config/search/engines/default.nix b/modules/home.legacy/conf/firefox/config/search/engines/default.nix
index a47c77df..7e7880ca 100644
--- a/modules/home.legacy/conf/firefox/config/search/engines/default.nix
+++ b/modules/home.legacy/conf/firefox/config/search/engines/default.nix
@@ -13,6 +13,12 @@
     definedAliases = ["@np"];
   };
 
+  "Nix functions" = {
+    urls = [{template = "https://noogle.dev/q?term={searchTerms}";}];
+    icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+    definedAliases = ["@ng"];
+  };
+
   "NixOS Options" = {
     urls = [{template = "https://search.nixos.org/options?type=options&query={searchTerms}";}];
     icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
diff --git a/modules/home.legacy/conf/mail/default.nix b/modules/home.legacy/conf/mail/default.nix
index 0ecbe40a..9c2554ee 100644
--- a/modules/home.legacy/conf/mail/default.nix
+++ b/modules/home.legacy/conf/mail/default.nix
@@ -1,15 +1,47 @@
 {
   config,
   pkgs,
+  lib,
   ...
 }: let
   benedikt = import ./accounts/benedikt.nix {inherit pkgs;};
   soispha = import ./accounts/soispha.nix {inherit pkgs;};
 
   accounts = {inherit soispha benedikt;};
+
+  mkHelper = {
+    userName,
+    passwordCommand,
+    ...
+  }:
+    builtins.toString (pkgs.writeShellScript "git-credential-keepassxc-libsecret"
+      # bash
+      ''
+        [ "$1" = "get" ] || {
+          exit 1
+        }
+        if cat | grep "username=${userName}" -q; then
+          ${passwordCommand}
+        else
+          # Not our business.
+          exit 1
+        fi
+      '');
+  accountCredentials =
+    # TODO: This will result in only one of them being defined, as we duplicate the
+    # attribute key<2025-02-03>
+    lib.mapAttrs' (_: value: {
+      name = "credential.smtp://${value.smtp.host}:${builtins.toString value.smtp.port}";
+      value = {
+        "helper" = mkHelper value;
+      };
+    })
+    accounts;
 in {
   accounts.email = {
     maildirBasePath = "${config.xdg.dataHome}/maildir";
     inherit accounts;
   };
+
+  programs.git.extraConfig = accountCredentials;
 }
diff --git a/modules/home.legacy/conf/mbsync/default.nix b/modules/home.legacy/conf/mbsync/default.nix
index ac9808c9..8418d92d 100644
--- a/modules/home.legacy/conf/mbsync/default.nix
+++ b/modules/home.legacy/conf/mbsync/default.nix
@@ -1,17 +1,16 @@
-{
-  config,
-  lib,
-  ...
-}: {
-  # TODO: I have no clue if both are needed, but it looks neat, right?
+{lib, ...}: {
+  # This configures the program in itself (i.e., sets-up a config file, etc.)
   programs.mbsync = {
     enable = true;
   };
+
+  # This starts a systemd service to periodically sync mail
   services.mbsync = {
     enable = true;
-    # TODO: enable after isync 1.5 drops
-    #configFile = "${config.xdg.configHome}/mbsync/mbsync.conf";
   };
-  # Disable the timer, and only activate it on neomutt start
+
+  # Disable the timer, and only activate the service when neomutt starts
+  # Otherwise, the password command would prompt me to unlock the keepassxc database every
+  # time.
   systemd.user.timers.mbsync = lib.mkForce {};
 }
diff --git a/modules/home.legacy/conf/mpv/default.nix b/modules/home.legacy/conf/mpv/default.nix
deleted file mode 100644
index 6b252a38..00000000
--- a/modules/home.legacy/conf/mpv/default.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{...}: {
-  programs.mpv = {
-    enable = true;
-    bindings = {
-      q = "quit 0";
-      "Ctrl+c" = "quit 1";
-      "Shift+q" = "quit-watch-later 1";
-    };
-  };
-}