diff options
author | Ben Sima <ben@bensima.com> | 2025-04-18 12:53:49 -0400 |
---|---|---|
committer | Ben Sima <ben@bensima.com> | 2025-04-18 12:55:04 -0400 |
commit | 98bee4bb031d6a0802ffe5a33119bc2316e6cb05 (patch) | |
tree | 61999b376458ae9c04d78805859761d266af51c2 | |
parent | b8e841f0bc42a0127462db6ed4052162a53525e1 (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
-rw-r--r-- | lib/afew.ini | 2 | ||||
-rw-r--r-- | lib/calendars.nix | 96 | ||||
-rw-r--r-- | lib/common.nix | 8 | ||||
-rw-r--r-- | lib/config.nix | 1 | ||||
-rw-r--r-- | lib/emacs-packages.nix | 12 | ||||
-rw-r--r-- | lib/emacs.nix | 6 | ||||
-rw-r--r-- | lib/email.nix | 90 | ||||
-rw-r--r-- | lib/linux.nix | 20 | ||||
-rw-r--r-- | lib/msmtprc | 18 | ||||
-rw-r--r-- | lib/muttrc | 12 | ||||
-rw-r--r-- | lib/packages.nix | 3 | ||||
-rw-r--r-- | lib/ssh.nix | 13 | ||||
-rw-r--r-- | machines/boron.nix | 10 | ||||
-rw-r--r-- | profiles/beryllium.nix | 12 | ||||
-rw-r--r-- | profiles/laptop.nix | 142 |
15 files changed, 287 insertions, 158 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 @@ -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"; }; }; diff --git a/machines/boron.nix b/machines/boron.nix index a7963cd..c56d61c 100644 --- a/machines/boron.nix +++ b/machines/boron.nix @@ -69,6 +69,10 @@ LC_TIME = "en_US.UTF-8"; }; + services.pcscd = { + enable = true; + }; + # Enable the X11 windowing system. services.xserver.enable = true; @@ -134,6 +138,7 @@ # don't put this in user cfg because it's wayland specific, and i don't use # wayland everwhere wl-clipboard + zoom-us # need for job searching ]; programs.winbox = { @@ -151,6 +156,11 @@ # ]; #}; + programs.firefox = { + enable = true; + nativeMessagingHosts.passff = true; + }; + # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. diff --git a/profiles/beryllium.nix b/profiles/beryllium.nix index f861d94..d9e2faa 100644 --- a/profiles/beryllium.nix +++ b/profiles/beryllium.nix @@ -8,20 +8,22 @@ let xresourcesFile; in { imports = [ + ../lib/calendars.nix + ../lib/common.nix + ../lib/emacs.nix + ../lib/email.nix ../lib/linux.nix - ../lib/urxvt.nix + ../lib/packages.nix ../lib/polybar.nix ../lib/ssh.nix - ../lib/packages.nix - ../lib/emacs.nix - ../lib/email.nix + ../lib/urxvt.nix ]; home = { packages = with pkgs; [ zulip reaper - obs-studio + obs-studio ]; }; diff --git a/profiles/laptop.nix b/profiles/laptop.nix index d34baea..9409a77 100644 --- a/profiles/laptop.nix +++ b/profiles/laptop.nix @@ -1,16 +1,19 @@ -# helium laptop +# helium / boron laptops { pkgs, lib, ... }: { imports = [ + ../lib/calendars.nix ../lib/common.nix - ../lib/urxvt.nix - ../lib/linux.nix ../lib/emacs.nix - ../lib/ssh.nix + ../lib/email.nix + ../lib/linux.nix ../lib/packages.nix - # ../lib/email.nix + # ../lib/polybar.nix + ../lib/ssh.nix + ../lib/urxvt.nix ]; + nixpkgs.config = import ../lib/config.nix; home = { packages = with pkgs; [ @@ -22,63 +25,68 @@ ]; }; - services.polybar.enable = true; + services.polybar.enable = false; services.polybar.script = "polybar top &"; services.polybar.config."bar/top".monitor = "\${env:MONITOR:HDMI-2}"; services.polybar.config."bar/top".monitor-fallback = "\${env:MONITOR:eDP-1}"; - programs.autorandr.enable = true; - - programs.autorandr.hooks.postswitch = { - "restart-polybar" = "systemctl --user restart polybar.service"; - }; - - programs.autorandr.profiles = let - fingerprint = { - # get fingerprints with `autorandr --fingerprint` - eDP-1 = "00ffffffffffff000daea814000000002c170104951f11780237459e55539229125054000000010101010101010101010101010101015e358096703814402c1c240034ad10000018000000fe004e3134304847452d4541310a20000000fe00434d4e0a202020202020202020000000fe004e3134304847452d4541310a20001f"; - HDMI-2 = "00ffffffffffff0006b3ca28305f010025200103803e22782aad65ad50459f250e50542308008140818081c081009500b300d1c001014dd000a0f0703e80303035006d552100001a565e00a0a0a02950302035006d552100001e000000fd00283c1ea03c000a202020202020000000fc0041535553205647323839513141012b02034df154010304121305141f1007060260610e0f15161d1e2309070783010000e200d567030c001000383c67d85dc401788003681a00000101283ef0e305e301e40f003000e606070159521c023a801871382d40582c45006d552100001e00000000000000000000000000000000000000000000000000000000000000009e"; - }; - - externalMonitor = rotate: { - enable = true; - primary = true; - position = "0x0"; - mode = "2560x1440"; - dpi = 221; - rate = "60.00"; - inherit rotate; - }; - - laptopScreen = { - enable = true; - primary = true; - position = "0x0"; - mode = "1920x1080"; - rate = "60.00"; - dpi = 156; + # https://github.com/nix-community/home-manager/issues/3263#issuecomment-1328664060 + xdg.configFile."autostart/gnome-keyring-ssh.desktop".text = '' + [Desktop Entry] + Type=Application + Hidden=true + ''; + + programs.autorandr = { + enable = true; + hooks.postswitch = { + "restart-polybar" = "systemctl --user restart polybar.service"; }; + profiles = let + fingerprint = { + # get fingerprints with `autorandr --fingerprint` + eDP-1 = "00ffffffffffff000daea814000000002c170104951f11780237459e55539229125054000000010101010101010101010101010101015e358096703814402c1c240034ad10000018000000fe004e3134304847452d4541310a20000000fe00434d4e0a202020202020202020000000fe004e3134304847452d4541310a20001f"; + HDMI-2 = "00ffffffffffff0006b3ca28305f010025200103803e22782aad65ad50459f250e50542308008140818081c081009500b300d1c001014dd000a0f0703e80303035006d552100001a565e00a0a0a02950302035006d552100001e000000fd00283c1ea03c000a202020202020000000fc0041535553205647323839513141012b02034df154010304121305141f1007060260610e0f15161d1e2309070783010000e200d567030c001000383c67d85dc401788003681a00000101283ef0e305e301e40f003000e606070159521c023a801871382d40582c45006d552100001e00000000000000000000000000000000000000000000000000000000000000009e"; + }; + externalMonitor = rotate: { + enable = true; + primary = true; + position = "0x0"; + mode = "2560x1440"; + dpi = 221; + rate = "60.00"; + inherit rotate; + }; + laptopScreen = { + enable = true; + primary = true; + position = "0x0"; + mode = "1920x1080"; + rate = "60.00"; + dpi = 156; + }; - in { - #docked-portrait = { - # fingerprint = { inherit (fingerprint) HDMI-2; }; - # config = { - # eDP-1.enable = false; - # HDMI-2 = externalMonitor "right"; - # }; - #}; - docked = { - inherit fingerprint; - config = { - eDP-1.enable = false; - HDMI-2 = externalMonitor "normal"; + in { + #docked-portrait = { + # fingerprint = { inherit (fingerprint) HDMI-2; }; + # config = { + # eDP-1.enable = false; + # HDMI-2 = externalMonitor "right"; + # }; + #}; + docked = { + inherit fingerprint; + config = { + eDP-1.enable = false; + HDMI-2 = externalMonitor "normal"; + }; }; - }; - laptop = { - fingerprint = { inherit (fingerprint) eDP-1; }; - config = { - HDMI-2.enable = false; - eDP-1 = laptopScreen; + laptop = { + fingerprint = { inherit (fingerprint) eDP-1; }; + config = { + HDMI-2.enable = false; + eDP-1 = laptopScreen; + }; }; }; }; @@ -89,7 +97,6 @@ enable = false; backend = "glx"; vSync = true; - # Transparency/Opacity inactiveOpacity = 0.70; activeOpacity = 0.95; @@ -98,16 +105,13 @@ "100:class_g *?= 'Deadd-notification-center'" "100:class_g *?= 'Rofi'" ]; - # Fading fade = true; fadeDelta = 5; - # Shadows shadowExclude = [ "class_g = 'eww-topbar-btw'" ]; - settings = { # Blur blur-method = "dual_kawase"; @@ -115,7 +119,6 @@ blur-backgroud-exclude = [ "class_g = 'eww-topbar-btw'" ]; - # Radius corner-radius = 10; round-borders = 1; @@ -124,23 +127,4 @@ ]; }; }; - - # this doesn't have an 'enable' option?? - #services.muchsync = { - # remotes = { - # lithium = { - # frequency = "*:0/05"; - # upload = true; - # remote = { - # host = "dev.simatime.com"; - # checkForModifiedFiles = true; - # importNew = true; - # }; - # local = { - # checkForModifiedFiles = true; - # importNew = true; - # }; - # }; - # }; - #}; } |