Use emacsclient to update mu index to make sure the db isn't locked
This commit is contained in:
parent
2808ce7436
commit
8e1b901372
6 changed files with 401 additions and 377 deletions
|
@ -1,10 +1,12 @@
|
|||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
launcher = import ./sway/launcher.nix { inherit pkgs; stdenv = pkgs.stdenv; };
|
||||
status-configuration = import ./sway/status-configuration.nix { inherit pkgs; };
|
||||
status-configuration = import ./sway/status-configuration.nix { inherit pkgs config; };
|
||||
in
|
||||
{
|
||||
imports = [ ./base-x.nix ];
|
||||
|
||||
config = {
|
||||
home-manager.users.charlotte = { pkgs, ... }: {
|
||||
xsession = {
|
||||
windowManager.i3 = {
|
||||
|
@ -37,4 +39,5 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
passwordScript = pkgs.writeShellScript "get_mail_password" ''${pkgs.pass}/bin/pass show "$@" | head -n1 | tr -d "\n"'';
|
||||
notifyScript = name: pkgs.writeShellScript "notify_${name}_mail" ''
|
||||
|
@ -28,7 +28,7 @@ let
|
|||
enable = true;
|
||||
boxes = [ "INBOX" ];
|
||||
onNotify = "${pkgs.isync}/bin/mbsync ${name}:INBOX";
|
||||
onNotifyPost = "${pkgs.mu}/bin/mu index && ${notifyScript name}";
|
||||
onNotifyPost = "${config.chvp.emacs.package}/bin/emacsclient --eval \"(mu4e-update-index)\" && ${notifyScript name}";
|
||||
};
|
||||
mbsync = {
|
||||
enable = true;
|
||||
|
@ -75,6 +75,7 @@ let
|
|||
toRecursiveINIBase 1;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
chvp.zfs.homeLinks = [
|
||||
{ path = "mail"; type = "data"; }
|
||||
{ path = ".cache/mu"; type = "cache"; }
|
||||
|
@ -277,7 +278,7 @@ in
|
|||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = [ "${pkgs.isync}/bin/mbsync -a" "${pkgs.mu}/bin/mu index" ];
|
||||
ExecStart = [ "${pkgs.isync}/bin/mbsync -a" "${config.chvp.emacs.package}/bin/emacsclient --eval \"(mu4e-update-index)\"" ];
|
||||
};
|
||||
};
|
||||
vdirsyncer = {
|
||||
|
@ -312,4 +313,5 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
launcher = import ./sway/launcher.nix { inherit pkgs; stdenv = pkgs.stdenv; };
|
||||
color-picker = import ./sway/color-picker.nix { inherit pkgs; };
|
||||
screenshot = import ./sway/screenshot.nix { inherit pkgs; };
|
||||
status-configuration = import ./sway/status-configuration.nix { inherit pkgs; };
|
||||
status-configuration = import ./sway/status-configuration.nix { inherit pkgs config; };
|
||||
in
|
||||
{
|
||||
config = {
|
||||
services.dbus.packages = with pkgs; [ gnome3.dconf ];
|
||||
security.pam.services.swaylock = { };
|
||||
xdg.portal = {
|
||||
|
@ -158,4 +159,5 @@ in
|
|||
xwayland = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
mic-status = pkgs.writeShellScript "mic-status" ''
|
||||
if [ "$(${pkgs.pulseaudio}/bin/pactl list sources | grep -o 'Mute: yes')" = "Mute: yes" ]
|
||||
|
@ -95,7 +95,7 @@ pkgs.writeText "configuration.toml" ''
|
|||
json = true
|
||||
command = "${mail-status}"
|
||||
interval = 1
|
||||
on_click = "${pkgs.isync}/bin/mbsync -a"
|
||||
on_click = "${pkgs.isync}/bin/mbsync -a && ${config.chvp.emacs.package}/bin/emacsclient --eval \"(mu4e-update-index)\""
|
||||
|
||||
[[block]]
|
||||
block = "time"
|
||||
|
|
|
@ -1,18 +1,7 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.chvp.emacs = {
|
||||
enable = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.chvp.emacs.enable {
|
||||
home-manager.users.charlotte = { ... }: {
|
||||
programs.emacs = {
|
||||
enable = true;
|
||||
package = pkgs.emacsWithPackagesFromUsePackage {
|
||||
let
|
||||
emacsPkg = pkgs.emacsWithPackagesFromUsePackage {
|
||||
config = ./emacs/init.el;
|
||||
package = pkgs.emacsPgtk;
|
||||
alwaysEnsure = true;
|
||||
|
@ -21,12 +10,40 @@
|
|||
pkgs.mu
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
options.chvp.emacs = {
|
||||
enable = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
};
|
||||
package = lib.mkOption { };
|
||||
};
|
||||
|
||||
config = lib.mkIf config.chvp.emacs.enable {
|
||||
chvp = {
|
||||
emacs.package = emacsPkg;
|
||||
zfs.homeLinks = [
|
||||
{ path = ".emacs.d"; type = "cache"; }
|
||||
];
|
||||
};
|
||||
|
||||
home-manager.users.charlotte = { ... }: {
|
||||
services.emacs = {
|
||||
enable = true;
|
||||
client.enable = true;
|
||||
package = emacsPkg;
|
||||
};
|
||||
home = {
|
||||
file = {
|
||||
".emacs.d/early-init.el".source = ./emacs/early-init.el;
|
||||
".emacs.d/init.el".source = ./emacs/init.el;
|
||||
};
|
||||
packages = [
|
||||
(pkgs.writeShellScriptBin "emacs" ''
|
||||
${emacsPkg}/bin/emacsclient -c $@
|
||||
'')
|
||||
];
|
||||
sessionVariables = { EDITOR = "emacs"; };
|
||||
};
|
||||
};
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
"hv" '(describe-variable :which-key "variable")
|
||||
|
||||
"q" '(:ignore t :which-key "quit")
|
||||
"qq" '(save-buffers-kill-emacs :which-key "quit")
|
||||
"qq" '(delete-frame :which-key "quit")
|
||||
|
||||
"s" '(:ignore t :which-key "search")
|
||||
|
||||
|
@ -394,14 +394,14 @@
|
|||
(setq inhibit-startup-screen t)
|
||||
|
||||
;; Font configuration
|
||||
(when window-system (set-frame-font "Fira Code 9"))
|
||||
(defun emoji-fonts ()
|
||||
"Setup emoji font priorities."
|
||||
(defun font-settings ()
|
||||
"Setup font settings."
|
||||
(when window-system (set-frame-font "Fira Code 9"))
|
||||
(set-fontset-font t 'symbol "Noto Color Emoji")
|
||||
(set-fontset-font t 'symbol "Symbola" nil 'append))
|
||||
(if (daemonp)
|
||||
(add-hook 'server-after-make-frame-hook #'emoji-fonts)
|
||||
(emoji-fonts))
|
||||
(add-hook 'server-after-make-frame-hook #'font-settings)
|
||||
(font-settings))
|
||||
|
||||
(provide 'init)
|
||||
;;; init.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue