add more comments and utilities

This commit is contained in:
Noah Masur 2023-07-29 23:56:41 -04:00
parent 95e04de763
commit 0ed3633404
8 changed files with 54 additions and 11 deletions

View File

@ -40,7 +40,10 @@
extraConfig = ""; extraConfig = "";
font.size = 14; font.size = 14;
keybindings = { keybindings = {
# Use shift+enter to complete text suggestions in fish
"shift+enter" = "send_text all \\x1F"; "shift+enter" = "send_text all \\x1F";
# Easy fullscreen toggle (for macOS)
"super+f" = "toggle_fullscreen"; "super+f" = "toggle_fullscreen";
}; };
settings = { settings = {
@ -98,7 +101,7 @@
tab_bar_edge = "top"; tab_bar_edge = "top";
tab_bar_style = "slant"; tab_bar_style = "slant";
# Audio # Disable audio
enable_audio_bell = false; enable_audio_bell = false;
}; };
}; };

View File

@ -22,8 +22,8 @@
enable = true; enable = true;
bindings = { }; bindings = { };
config = { config = {
image-display-duration = 2; image-display-duration = 2; # For cycling through images
hwdec = "auto-safe"; hwdec = "auto-safe"; # Attempt to use GPU decoding for video
}; };
scripts = [ scripts = [
@ -49,7 +49,7 @@
]; ];
}; };
# Set default for opening PDFs # Set default programs for opening PDFs and other media
xdg.mimeApps = { xdg.mimeApps = {
associations.added = { associations.added = {
"application/pdf" = [ "pwmt.zathura-cb.desktop" ]; "application/pdf" = [ "pwmt.zathura-cb.desktop" ];

View File

@ -27,19 +27,31 @@
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
programs.mbsync = { enable = true; }; programs.mbsync = { enable = true; };
# Automatically check for mail and keep files synced locally
services.mbsync = lib.mkIf pkgs.stdenv.isLinux { services.mbsync = lib.mkIf pkgs.stdenv.isLinux {
enable = true; enable = true;
frequency = "*:0/5"; frequency = "*:0/5";
postExec = "${pkgs.notmuch}/bin/notmuch new"; postExec = "${pkgs.notmuch}/bin/notmuch new";
}; };
# Used to watch for new mail and trigger sync
services.imapnotify.enable = pkgs.stdenv.isLinux; services.imapnotify.enable = pkgs.stdenv.isLinux;
# Allows sending email from CLI/sendmail
programs.msmtp.enable = true; programs.msmtp.enable = true;
# Better local mail search
programs.notmuch = { programs.notmuch = {
enable = true; enable = true;
new.ignore = [ ".mbsyncstate.lock" ".mbsyncstate.journal" ]; new.ignore = [ ".mbsyncstate.lock" ".mbsyncstate.journal" ];
}; };
accounts.email = { accounts.email = {
# Where email files are stored
maildirBasePath = "${config.homePath}/mail"; maildirBasePath = "${config.homePath}/mail";
accounts = { accounts = {
home = let address = "${config.mail.user}@${config.mail.server}"; home = let address = "${config.mail.user}@${config.mail.server}";
in { in {
@ -52,13 +64,17 @@
"hey" "hey"
"admin" "admin"
]; ];
# Options for contact completion
alot = { }; alot = { };
flavor = "plain";
imap = { imap = {
host = config.mail.imapHost; host = config.mail.imapHost;
port = 993; port = 993;
tls.enable = true; tls.enable = true;
}; };
# Watch for mail and run notifications or sync
imapnotify = { imapnotify = {
enable = true; enable = true;
boxes = [ "Inbox" ]; boxes = [ "Inbox" ];
@ -67,7 +83,11 @@
config.home-manager.users.${config.user}.services.dunst.enable config.home-manager.users.${config.user}.services.dunst.enable
"${pkgs.libnotify}/bin/notify-send 'New mail arrived'"; "${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
}; };
# Name of the directory in maildir for this account
maildir = { path = "main"; }; maildir = { path = "main"; };
# Bi-directional syncing options for local files
mbsync = { mbsync = {
enable = true; enable = true;
create = "both"; create = "both";
@ -78,12 +98,17 @@
CopyArrivalDate = "yes"; # Sync time of original message CopyArrivalDate = "yes"; # Sync time of original message
}; };
}; };
# Enable indexing
notmuch.enable = true; notmuch.enable = true;
# Used to login and send and receive emails
passwordCommand = passwordCommand =
"${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${ "${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${
pkgs.writeText "mailpass.age" pkgs.writeText "mailpass.age"
(builtins.readFile ../../../private/mailpass.age) (builtins.readFile ../../../private/mailpass.age)
}"; }";
smtp = { smtp = {
host = config.mail.smtpHost; host = config.mail.smtpHost;
port = 465; port = 465;

View File

@ -1,4 +1,7 @@
{ pkgs, ... }: { { pkgs, ... }: {
# Plugin for aligning text programmatically
plugins = [ pkgs.vimPlugins.tabular ]; plugins = [ pkgs.vimPlugins.tabular ];
lua = '' lua = ''
-- Align -- Align

View File

@ -1,4 +1,7 @@
{ pkgs, ... }: { { pkgs, ... }: {
# Shows buffers in a VSCode-style tab layout
plugins = [ plugins = [
pkgs.vimPlugins.bufferline-nvim pkgs.vimPlugins.bufferline-nvim
pkgs.vimPlugins.vim-bbye # Better closing of buffers pkgs.vimPlugins.vim-bbye # Better closing of buffers

View File

@ -1,5 +1,7 @@
{ pkgs, lib, config, ... }: { { pkgs, lib, config, ... }: {
# Sets Neovim colors based on Nix colorscheme
options.colors = lib.mkOption { options.colors = lib.mkOption {
type = lib.types.attrsOf lib.types.str; type = lib.types.attrsOf lib.types.str;
description = "Attrset of base16 colorscheme key value pairs."; description = "Attrset of base16 colorscheme key value pairs.";

View File

@ -24,12 +24,14 @@
end end
''; '';
# Enable Luasnip snippet completion
snippet.expand = dsl.rawLua '' snippet.expand = dsl.rawLua ''
function(args) function(args)
require("luasnip").lsp_expand(args.body) require("luasnip").lsp_expand(args.body)
end end
''; '';
# Basic completion keybinds
mapping = { mapping = {
"['<C-n>']" = dsl.rawLua "['<C-n>']" = dsl.rawLua
"require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })"; "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })";
@ -64,24 +66,26 @@
''; '';
}; };
# These are where the completion engine gets its suggestions
sources = [ sources = [
{ name = "nvim_lua"; } { name = "nvim_lua"; } # Fills in common Neovim lua functions
{ name = "nvim_lsp"; } { name = "nvim_lsp"; } # LSP results
{ name = "luasnip"; } { name = "luasnip"; } # Snippets
{ name = "path"; } { name = "path"; } # Shell completion from current PATH
{ {
name = "buffer"; name = "buffer"; # Grep for text from the current text buffer
keyword_length = 3; keyword_length = 3;
max_item_count = 10; max_item_count = 10;
} }
{ {
name = "rg"; name = "rg"; # Grep for text from the current directory
keyword_length = 6; keyword_length = 6;
max_item_count = 10; max_item_count = 10;
option = { additional_arguments = "--ignore-case"; }; option = { additional_arguments = "--ignore-case"; };
} }
]; ];
# Styling of the completion menu
formatting = { formatting = {
fields = [ "kind" "abbr" "menu" ]; fields = [ "kind" "abbr" "menu" ];
format = dsl.rawLua '' format = dsl.rawLua ''

View File

@ -35,6 +35,9 @@ in {
tree # View directory hierarchy tree # View directory hierarchy
vimv-rs # Batch rename files vimv-rs # Batch rename files
unzip # Extract zips unzip # Extract zips
dua # File sizes (du)
du-dust # Disk usage tree (ncdu)
duf # Basic disk information (df)
]; ];
programs.zoxide.enable = true; # Shortcut jump command programs.zoxide.enable = true; # Shortcut jump command