spice up cli life some more:

- mx for fzf manix
- orage maybe useful as a calendar??
- email notifications
- all user services allowed to send notifications
This commit is contained in:
Anish Lakhwara 2022-12-18 02:58:13 +10:00
parent 00c9c074c1
commit 332103c227
4 changed files with 14 additions and 40 deletions

View file

@ -4,6 +4,7 @@
binutils
coreutils
dnsutils
dasht
dosfstools
#git
bottom
@ -87,6 +88,9 @@
fi
vim flake.nix
}
mx() {
manix "" | grep '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | fzf --preview="manix '{}'" | xargs manix
}
autopair-init
'';
sessionVariables = {

View file

@ -31,6 +31,9 @@ in
inotify-tools
];
# set up env
xsession.enable = true;
xresources.properties = {
"*.foreground" = "#95E6CB";
"*.background" = "#1F2430";

View file

@ -1,35 +1,4 @@
{ config, pkgs, lib, ... }:
with lib;
let
safeName = lib.replaceStrings [ "@" ":" "\\" "[" "]" ] [ "-" "-" "-" "" "" ];
imapnotifyAccounts =
filter (a: a.imapnotify.enable) (attrValues config.accounts.email.accounts);
genAccountUnit = account:
let name = safeName account.name;
in
{
name = "imapnotify-${name}-mine";
value = {
Unit = { Description = "imapnotify for ${name}"; };
Service = {
ExecStart = "${pkgs.goimapnotify}/bin/goimapnotify -conf /nix/store/6030i9xdga98l2zyqarrqv5mrjynwm3i-imapnotify-anish-config.json"; # TODO horrible hard coded config location
Restart = "always";
RestartSec = 30;
Type = "simple";
# this is why we're overriding this stupid thing
# We need dbus for notify-send on systemd
Environment = [
"DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus"
"NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/default/config"
];
};
Install = { WantedBy = [ "default.target" ]; };
};
};
in
{ pkgs, ... }:
{
#age.secrets.fastmail.file = "/etc/nixos/secrets/fastmail.age";
#age.secrets.fastmail.owner = "anish";
@ -41,12 +10,9 @@ in
services.mbsync = {
enable = true;
frequency = "*:0/30";
#postExec = "${pkgs.notmuch}/bin/notmuch new";
postExec = "${pkgs.notmuch}/bin/notmuch new";
};
# call our stupid way of overriding the imapnotify service
systemd.user.services = listToAttrs (map genAccountUnit [{ name = "anish"; }]);
services.imapnotify.enable = true;
programs.mbsync.enable = true;
programs.msmtp.enable = true;
@ -304,10 +270,10 @@ in
extraConfig.local.subFolders = "Verbatim";
};
imapnotify = {
enable = false;
enable = true;
boxes = [ "Inbox" ];
onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch index";
onNotifyPost = "${pkgs.libnotify}/bin/notify-send -a mail 'email: new in %s'";
onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch new";
onNotifyPost = "${pkgs.libnotify}/bin/notify-send 'New Email 📩'";
};
msmtp.enable = true;
msmtp.extraConfig = {

View file

@ -66,6 +66,7 @@ in
scrot
ripcord
xfce.orage
feh
sxiv
xkblayout-state
@ -86,7 +87,7 @@ in
dunst
libnotify
(polybar.override {
pulseSupport = true;
pulseSupport = false;
nlSupport = true;
})
papirus-icon-theme