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

View file

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

View file

@ -1,35 +1,4 @@
{ config, pkgs, lib, ... }: { pkgs, ... }:
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
{ {
#age.secrets.fastmail.file = "/etc/nixos/secrets/fastmail.age"; #age.secrets.fastmail.file = "/etc/nixos/secrets/fastmail.age";
#age.secrets.fastmail.owner = "anish"; #age.secrets.fastmail.owner = "anish";
@ -41,12 +10,9 @@ in
services.mbsync = { services.mbsync = {
enable = true; enable = true;
frequency = "*:0/30"; 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; services.imapnotify.enable = true;
programs.mbsync.enable = true; programs.mbsync.enable = true;
programs.msmtp.enable = true; programs.msmtp.enable = true;
@ -304,10 +270,10 @@ in
extraConfig.local.subFolders = "Verbatim"; extraConfig.local.subFolders = "Verbatim";
}; };
imapnotify = { imapnotify = {
enable = false; enable = true;
boxes = [ "Inbox" ]; boxes = [ "Inbox" ];
onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch index"; onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch new";
onNotifyPost = "${pkgs.libnotify}/bin/notify-send -a mail 'email: new in %s'"; onNotifyPost = "${pkgs.libnotify}/bin/notify-send 'New Email 📩'";
}; };
msmtp.enable = true; msmtp.enable = true;
msmtp.extraConfig = { msmtp.extraConfig = {

View file

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