summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-04-18 12:53:49 -0400
committerBen Sima <ben@bensima.com>2025-04-18 12:55:04 -0400
commit98bee4bb031d6a0802ffe5a33119bc2316e6cb05 (patch)
tree61999b376458ae9c04d78805859761d266af51c2 /lib
parentb8e841f0bc42a0127462db6ed4052162a53525e1 (diff)
lots of changes to get laptop (boron) working
- changed email address everywhere - added calendars - lots of emacs packages added/fixed - some tweaks for my laptop setup (fonts, gpg signing) - gpg forwarding over ssh finally works now!!! - refactored some stuff to accomodate laptop
Diffstat (limited to 'lib')
-rw-r--r--lib/afew.ini2
-rw-r--r--lib/calendars.nix96
-rw-r--r--lib/common.nix8
-rw-r--r--lib/config.nix1
-rw-r--r--lib/emacs-packages.nix12
-rw-r--r--lib/emacs.nix6
-rw-r--r--lib/email.nix90
-rw-r--r--lib/linux.nix20
-rw-r--r--lib/msmtprc18
-rw-r--r--lib/muttrc12
-rw-r--r--lib/packages.nix3
-rw-r--r--lib/ssh.nix13
12 files changed, 207 insertions, 74 deletions
diff --git a/lib/afew.ini b/lib/afew.ini
index 2ea82a3..013383b 100644
--- a/lib/afew.ini
+++ b/lib/afew.ini
@@ -20,7 +20,7 @@ Junk = 'NOT tag:spam AND tag:inbox':INBOX 'NOT tag:spam':Archive
[Filter.0]
message = mobile todos
-query = 'from:ben@bsima.me AND to:ben@bsima.me AND subject:TODO'
+query = 'from:ben@bensima.com AND to:ben@bensima.com AND subject:TODO'
tags = +todo;-inbox;+unread
[Filter.1]
diff --git a/lib/calendars.nix b/lib/calendars.nix
new file mode 100644
index 0000000..9e96462
--- /dev/null
+++ b/lib/calendars.nix
@@ -0,0 +1,96 @@
+{...}:
+let
+ common = {
+ vdirsyncer = {
+ enable = true;
+ auth = "basic";
+ conflictResolution = "remote wins";
+ metadata = [
+ "displayname"
+ "description"
+ ];
+ timeRange = {
+ # sync 1 year before and after now
+ start = "datetime.now() - timedelta(days=365)";
+ end = "datetime.now() + timedelta(days=365)";
+ };
+ };
+ };
+in {
+ accounts.calendar.basePath = "Calendars";
+ accounts.calendar.accounts = {
+ "bensima_personal" = {
+ primaryCollection = "Unschedule";
+ remote = {
+ passwordCommand = ["pass" "cal.bensima.com"];
+ type = "caldav";
+ url = "https://cal.bensima.com";
+ userName = "ben";
+ };
+ vdirsyncer = {
+ inherit (common.vdirsyncer) metadata timeRange enable auth conflictResolution;
+ collections = [
+ "3e40534f-bfb9-b973-f615-f958a6361e95"
+ "066441A6-B48F-439B-9BD0-5D0FA8F4CB6F"
+ ];
+ };
+ khal = {
+ enable = true;
+ addresses = ["ben@bensima.com" "ben@bsima.me"];
+ color = "#800080";
+ type = "discover";
+ };
+ };
+
+ "bensima_shared" = {
+ remote = {
+ passwordCommand = ["pass" "cal.bensima.com"];
+ type = "caldav";
+ url = "https://cal.bensima.com/shared/ben";
+ userName = "ben";
+ };
+ vdirsyncer = common.vdirsyncer;
+ khal = {
+ enable = true;
+ color = "#097969";
+ type = "calendar";
+ };
+ };
+
+ "icloud" = {
+ remote = {
+ passwordCommand = ["pass" "icloud.com/vdirsyncer"];
+ type = "caldav";
+ url = "https://caldav.icloud.com";
+ userName = "bsima@icloud.com";
+ };
+ vdirsyncer = {
+ inherit (common.vdirsyncer) metadata timeRange enable auth conflictResolution;
+ collections = [
+ "0962a74ab76a97543b485d2a583caa271042baab9d64437ae6c3bc8a50df1f08"
+ ];
+ };
+ khal = {
+ enable = true;
+ color = "#FAA0A0";
+ type = "discover";
+ };
+ };
+ };
+
+ programs.khal = {
+ enable = true;
+ locale = {
+ # these need to match org-mode formats for khalel
+ weeknumbers = "left";
+ timeformat = "%H:%M";
+ dateformat = "%Y-%m-%d";
+ longdateformat = "%Y-%m-%d %a";
+ datetimeformat = "%Y-%m-%d %H:%M";
+ longdatetimeformat = "%Y-%m-%d %H:%M";
+ };
+ };
+
+ programs.vdirsyncer.enable = true;
+ services.vdirsyncer.enable = true;
+}
diff --git a/lib/common.nix b/lib/common.nix
index 94cf1aa..d1efeb9 100644
--- a/lib/common.nix
+++ b/lib/common.nix
@@ -205,7 +205,7 @@ in {
programs.git = {
enable = true;
userName = "Ben Sima";
- userEmail = "ben@bsima.me";
+ userEmail = "ben@bensima.com";
ignores = [ "*~" "*.swp" ];
package = pkgs.gitAndTools.gitFull;
signing = {
@@ -253,13 +253,13 @@ in {
push.default = "current";
remote.pushDefault = "origin";
sendemail = {
- #smtpuser = "ben@bsima.me";
- #smtpserverport = 587;
+ smtpuser = "ben@bensima.com";
+ smtpserverport = 587;
smtpserver = "${homedir}/bin/sendmail";
chainreplyto = false;
composeencoding = "UTF-8";
annotate = "yes";
- cccmd = "git-contacts";
+ #cccmd = "git-contacts";
};
};
};
diff --git a/lib/config.nix b/lib/config.nix
index f4f4dad..7794e3e 100644
--- a/lib/config.nix
+++ b/lib/config.nix
@@ -6,6 +6,7 @@
"electron-13.6.9"
"electron-25.9.0"
"electron-24.8.5" # for obsidian
+ "electron-32.3.3"
];
cudaSupport = false;
}
diff --git a/lib/emacs-packages.nix b/lib/emacs-packages.nix
index bacb94a..023aba5 100644
--- a/lib/emacs-packages.nix
+++ b/lib/emacs-packages.nix
@@ -28,8 +28,9 @@ dired-narrow
direnv
doom-themes
doom-modeline
-ellama
+#ellama # install manually, this version is too old
embark
+embark-consult
editorconfig
erc-hl-nicks
evil
@@ -40,6 +41,8 @@ evil-org
evil-surround
emojify
eww-lnum
+exercism
+fira-code-mode
flycheck
flycheck-haskell
fzf
@@ -58,6 +61,7 @@ imenu-anywhere
indent-guide
ivy
ix
+khalel
keycast
ledger-mode
lispy
@@ -65,12 +69,14 @@ magit
marginalia
markdown-mode
mixed-pitch
+mu4e
multiple-cursors
neotree
notmuch
nix-buffer
nix-mode
ol-notmuch
+org-alert
org-clock-today
org-contrib
org-drill
@@ -94,8 +100,10 @@ rust-mode
s
solaire-mode
slime
+spacemacs-theme
+sr-speedbar
swiper
-sx
+#sx # build failure
undo-tree
use-package
which-key
diff --git a/lib/emacs.nix b/lib/emacs.nix
index df7b036..39af44d 100644
--- a/lib/emacs.nix
+++ b/lib/emacs.nix
@@ -1,9 +1,11 @@
-{ ... }:
+{ pkgs, ... }:
{
+ home.packages = [
+ pkgs.exercism # goes with exercism.el
+ ];
programs.emacs = {
enable = true;
extraPackages = epkgs: import ./emacs-packages.nix { inherit epkgs; };
};
}
-
diff --git a/lib/email.nix b/lib/email.nix
index 05cfd7e..2867a2c 100644
--- a/lib/email.nix
+++ b/lib/email.nix
@@ -1,45 +1,55 @@
-{ pkgs, lib, ... }:
+{ pkgs, lib, config, ... }:
let
- gpgid = "D09299626FA78AF8";
- homedir = builtins.getEnv "HOME";
+ inherit (import ./const.nix) homedir gpgid;
+ common = {
+ alot.sendMailCommand = "${homedir}/bin/sendmail";
+ imap = {
+ host = "bensima.com";
+ port = 993;
+ };
+ smtp = {
+ host = "bensima.com";
+ port = 587;
+ tls = {
+ enable = true;
+ useStartTls = true;
+ };
+ };
+ gpg = {
+ key = gpgid;
+ signByDefault = true;
+ encryptByDefault = false;
+ };
+ mbsync = {
+ create = "both";
+ expunge = "both";
+ remove = "both";
+ extraConfig.channel = { MaxMessages = 1000; };
+ };
+ passwordCommand = "${pkgs.pass}/bin/pass ben@bensima.com";
+ msmtp.enable = true;
+ mu.enable = true;
+ };
in
{
accounts = {
email = {
maildirBasePath = "${homedir}/Mail";
accounts = {
- "ben@simatime.com" = {
+ "ben@bensima.com" = common // {
primary = true;
realName = "Ben Sima";
- address = "ben@bsima.me";
- userName = "ben@simatime.com";
- alot.sendMailCommand = "${homedir}/bin/sendmail";
- imap = {
- host = "simatime.com";
- port = 993;
- };
- smtp = {
- host = "simatime.com";
- port = 587;
- tls = {
- enable = true;
- useStartTls = true;
- };
- };
- gpg = {
- key = gpgid;
- signByDefault = true;
- encryptByDefault = false;
- };
- mbsync = {
- enable = true;
- create = "both";
- expunge = "none";
- };
- notmuch.enable = true;
- passwordCommand = "${pkgs.coreutils}/bin/cat ~/private/ben@simatime.com";
- msmtp.enable = true;
+ address = "ben@bensima.com";
+ userName = "ben@bensima.com";
+ mbsync.enable = true;
+ };
+
+ "dev@bensima.com" = common // {
+ realName = "Ben Sima";
+ address = "dev@bensima.com";
+ userName = "dev@bensima.com";
+ mbsync.enable = false;
};
};
};
@@ -47,7 +57,7 @@ in
programs = {
notmuch = {
- enable = true;
+ enable = false;
new.tags = [ "new" ];
maildir.synchronizeFlags = true;
hooks = {
@@ -65,7 +75,7 @@ in
};
afew = {
- enable = true;
+ enable = false;
extraConfig = builtins.readFile ./afew.ini;
};
@@ -76,12 +86,18 @@ in
'';
};
- mbsync = {
- enable = true;
- };
+ mbsync.enable = true;
msmtp = {
enable = true;
};
+
+ mu.enable = true;
+ };
+
+ services = {
+ mbsync.enable = false; # just update manually in emacs
+ mbsync.frequency = "hourly";
+ mbsync.postExec = "${config.programs.mu.package}/bin/mu index";
};
}
diff --git a/lib/linux.nix b/lib/linux.nix
index 51fa65d..d4568c4 100644
--- a/lib/linux.nix
+++ b/lib/linux.nix
@@ -15,10 +15,8 @@ in
{
imports = [
./common.nix
-
# nix-channel --add https://github.com/catppuccin/nix/archive/main.tar.gz catppuccin
#<catppuccin/modules/home-manager>
-
];
home = {
pointerCursor = {
@@ -129,12 +127,6 @@ in
kbfs.enable = false;
keybase.enable = false;
- mbsync = {
- frequency = "*:0/5";
- postExec = "${pkgs.notmuch}/bin/notmuch new";
- };
-
-
dunst = {
enable = true;
settings = {
@@ -210,9 +202,15 @@ in
};
};
- programs.gpg.enable = true;
- programs = {
+ programs.gpg = {
+ enable = true;
+ scdaemonSettings = {
+ disable-ccid = true;
+ card-timeout = "5";
+ };
+ };
+ programs = {
git.signing.signByDefault = true;
firefox = {
@@ -221,7 +219,7 @@ in
if lib.versionAtLeast config.home.stateVersion "19.09"
then pkgs.firefox
else pkgs.firefox-unwrapped;
- nativeMessagingHosts = [ pkgs.firefoxpwa ];
+ nativeMessagingHosts = [ pkgs.firefoxpwa pkgs.passff-host ];
};
qutebrowser = {
diff --git a/lib/msmtprc b/lib/msmtprc
index 096525f..106b9ac 100644
--- a/lib/msmtprc
+++ b/lib/msmtprc
@@ -1,24 +1,24 @@
-account ben@bsima.me
+account ben@bensima.com
auth on
-from ben@bsima.me
-host mail.bsima.me
-user ben@bsima.me
+from ben@bensima.com
+host bensima.com
+user ben@bensima.com
passwordeval pass bnet/helium/mail/ben
port 587
tls on
# Get the fingerprint with
-# $ ~/bin/sslfingerprint mail.bsima.me
+# $ ~/bin/sslfingerprint bensima.com
tls_fingerprint B8:63:4C:8B:15:05:FC:F3:0B:CD:CF:5C:71:03:69:80:4E:26:AF:5B:B1:B2:F4:32:85:47:FA:7C:FD:8A:AA:E3
-account default : ben@bsima.me
+account default : ben@bensima.com
account ben@simatime.com
auth on
from ben@simatime.com
-host mail.simatime.com
+host simatime.com
user ben@simatime.com
-passwordeval pass simatime/mail/ben
+passwordeval pass ben@bensima.com
port 587
tls on
-tls_fingerprint 0B:E4:4B:8E:FD:11:E7:F3:CA:50:91:30:C2:56:34:87:6B:F4:7D:9B:59:2F:2D:55:83:43:A0:23:DB:00:5B:44 \ No newline at end of file
+tls_fingerprint 0B:E4:4B:8E:FD:11:E7:F3:CA:50:91:30:C2:56:34:87:6B:F4:7D:9B:59:2F:2D:55:83:43:A0:23:DB:00:5B:44
diff --git a/lib/muttrc b/lib/muttrc
index 4c0dd2c..220b1aa 100644
--- a/lib/muttrc
+++ b/lib/muttrc
@@ -3,8 +3,8 @@
set realname = "Ben Sima"
set mbox_type = Maildir
-my_hdr X-URL: https://www.bsima.me
-# my_hdr Bcc: ben@bsima.me
+my_hdr X-URL: https://www.bensima.com
+# my_hdr Bcc: ben@bensima.com
set editor = "vim -f"
set mail_check = 60
@@ -95,20 +95,20 @@ bind index,pager X change-vfolder
#set my_pw = "`pass bnet/helium/mail/ben`"
-set imap_user = "ben@bsima.me"
+set imap_user = "ben@bensima.com"
set imap_pass = $my_pw
set sendmail = msmtpq
-set from = "ben@bsima.me"
+set from = "ben@bensima.com"
set use_from = yes
-#set smtp_url = "smtp://ben@bsima.me@mail.bsima.me:587"
+#set smtp_url = "smtp://ben@bensima.com@bensima.com:587"
#set smtp_pass = $my_pw
set ssl_starttls = "yes"
-set folder = "~/Mail/ben@bsima.me"
+set folder = "~/Mail/ben@bensima.com"
set spoolfile = "+INBOX"
set postponed = "+Drafts"
set record = "+Sent"
diff --git a/lib/packages.nix b/lib/packages.nix
index 3be0c03..7ebd519 100644
--- a/lib/packages.nix
+++ b/lib/packages.nix
@@ -59,7 +59,8 @@ in {
fd
file
fira-code
- #fira-code-nerdfont
+ fira-code-symbols
+ fira-code-nerdfont
font-awesome_5
forgit
gcal
diff --git a/lib/ssh.nix b/lib/ssh.nix
index 6446a63..c6a73f2 100644
--- a/lib/ssh.nix
+++ b/lib/ssh.nix
@@ -10,8 +10,19 @@ in {
matchBlocks = {
"beryllium" = {
hostname = "beryllium";
+ forwardAgent = true;
+ remoteForwards = let path = a: b: {host.address = a; bind.address = b;};
+ in [
+ ( path
+ "/run/user/1000/gnupg/S.gpg-agent.extra"
+ "/run/user/1000/gnupg/S.gpg-agent.extra"
+ )
+ ( path
+ "/run/user/1000/gnupg/S.gpg-agent"
+ "/run/user/1000/gnupg/S.gpg-agent"
+ )
+ ];
extraOptions = {
- "RemoteForward" = "/run/user/1000/gnupg/S.gpg-agent /run/user/1000/gnupg/S.gpg-agent.extra";
"StreamLocalBindUnlink" = "yes";
};
};