declare screen settings and initial nvim setup

da81f70d18bd… · Ryan Schanzenbacher ·

parent c6a08aa02b67… diff

Changed files

diff --git a/hosts/RyanMac/configuration.nix b/hosts/RyanMac/configuration.nix
index 2c629bc..17ab123 100644
--- a/hosts/RyanMac/configuration.nix
+++ b/hosts/RyanMac/configuration.nix
@@ -89,6 +89,11 @@ in {
# System configuration
time.timeZone = "America/New_York";
+ power.sleep = {
+ display = 10;
+ computer = 30;
+ };
+
system.defaults = {
NSGlobalDomain = {
# 24 hour time
@@ -113,6 +118,12 @@ in {
ApplePressAndHoldEnabled = false;
};
+ # screensaver/power settings
+ screensaver = {
+ askForPassword = true;
+ askForPasswordDelay = 0;
+ };
+
# Control center stuff
controlcenter = {
BatteryShowPercentage = true;
diff --git a/users/ryan/home.nix b/users/ryan/home.nix
index de776c4..2c099ba 100644
--- a/users/ryan/home.nix
+++ b/users/ryan/home.nix
@@ -8,10 +8,14 @@
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
+ imports = [ ./modules ];
home.stateVersion = "26.05"; # Please read the comment before changing.
news.display = "silent";
+ # My own modules
+ ryan.neovim.enable = true;
+
programs.starship = {
enable = true;
settings = {
@@ -84,7 +88,6 @@
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
- neovim
git
yt-dlp
aerc
diff --git a/users/ryan/modules/default.nix b/users/ryan/modules/default.nix
new file mode 100644
index 0000000..55af9ec
--- /dev/null
+++ b/users/ryan/modules/default.nix
@@ -0,0 +1,15 @@
+{ lib, ... }:
+let
+ entries = builtins.readDir ./.;
+
+ modulesDirs = lib.filterAttrs
+ (name: type:
+ type == "directory" &&
+ builtins.pathExists (./. + "/${name}/default.nix"))
+ entries;
+in
+{
+ imports = map
+ (name: ./${name})
+ (builtins.attrNames modulesDirs);
+}
diff --git a/users/ryan/modules/nvim/default.nix b/users/ryan/modules/nvim/default.nix
new file mode 100644
index 0000000..83c9e1f
--- /dev/null
+++ b/users/ryan/modules/nvim/default.nix
@@ -0,0 +1,53 @@
+{config, lib, pkgs, ...}:
+
+with lib;
+
+let
+ cfg = config.ryan.neovim;
+in
+{
+ options.ryan.neovim.enable = mkEnableOption "Neovim";
+
+ config = mkIf cfg.enable {
+ programs.neovim = {
+ enable = true;
+
+ extraConfig = builtins.readFile ./init.vim;
+
+ initLua = builtins.readFile ./init.lua;
+
+ plugins = with pkgs.vimPlugins; [
+ vim-pandoc
+ vim-pandoc-syntax
+ vim-table-mode
+
+ tokyonight-nvim
+ lualine-nvim
+ nvim-web-devicons
+
+ coq_nvim
+ #coq-artifacts
+
+ (nvim-treesitter.withPlugins (p: [
+ p.zig
+ p.go
+ p.python
+ p.vim
+ ]))
+
+ #transparent-nvim
+ marks-nvim
+ leap-nvim
+ ];
+
+ extraPackages = with pkgs; [
+ pyright
+ gopls
+ zls
+ ];
+
+ };
+
+ xdg.configFile."nvim/after".source = ./extraConfigs/after;
+ };
+}
diff --git a/users/ryan/modules/nvim/extraConfigs/after/ftplugin/mail/custom.vim b/users/ryan/modules/nvim/extraConfigs/after/ftplugin/mail/custom.vim
new file mode 100644
index 0000000..75078e5
--- /dev/null
+++ b/users/ryan/modules/nvim/extraConfigs/after/ftplugin/mail/custom.vim
@@ -0,0 +1,2 @@
+setlocal tw=0 wm=0
+setlocal wrap linebreak
diff --git a/users/ryan/modules/nvim/extraConfigs/after/ftplugin/markdown/custom.vim b/users/ryan/modules/nvim/extraConfigs/after/ftplugin/markdown/custom.vim
new file mode 100644
index 0000000..96aac6e
--- /dev/null
+++ b/users/ryan/modules/nvim/extraConfigs/after/ftplugin/markdown/custom.vim
@@ -0,0 +1,2 @@
+"Used to overwrite table behavior in markdown files
+let b:table_mode_corner='+'
diff --git a/users/ryan/modules/nvim/init.lua b/users/ryan/modules/nvim/init.lua
new file mode 100644
index 0000000..2686f15
--- /dev/null
+++ b/users/ryan/modules/nvim/init.lua
@@ -0,0 +1,26 @@
+require('lualine').setup()
+local coq = require 'coq'
+--require("transparent")
+--require("mason").setup()
+--require("mason-lspconfig").setup {
+-- ensure_installed = { "pyright" },
+-- }
+
+-- nvim marks
+require'marks'.setup {
+ default_mappings = true
+}
+
+-- Leap keybinds
+config = function(_, opts)
+ vim.keymap.set({'n', 'x', 'o'}, 's', '<Plug>(leap-forward)')
+ vim.keymap.set({'n', 'x', 'o'}, 'S', '<Plug>(leap-backward)')
+ vim.keymap.set({'n', 'x', 'o'}, 'gs', '<Plug>(leap-from-window)')
+end
+
+--require'nvim-treesitter'.install { 'zig','go','python','vim' }
+
+vim.opt.conceallevel = 2
+vim.opt.concealcursor = nc
+
+--local lspconfig = require('lspconfig')
diff --git a/users/ryan/modules/nvim/init.vim b/users/ryan/modules/nvim/init.vim
new file mode 100644
index 0000000..8a4d54e
--- /dev/null
+++ b/users/ryan/modules/nvim/init.vim
@@ -0,0 +1,27 @@
+set nu rnu
+imap kj <Esc>
+set ts=4
+set sw=4
+set sts=4
+set et
+set mouse=
+set cursorline
+set cc=79
+
+"Load Theme
+colorscheme tokyonight-night
+
+"vim-pandoc config
+let g:pandoc#modules#disabled = ['spell', 'folding']
+
+"vim-table-mode config
+let g:table_mode_corner_corner='+'
+let g:table_mode_header_fillchar='='
+
+"pandoc render and open preview
+command Pv AsyncRun zathura '%:r.pdf'
+command Rd silent exec "!pandoc -t pdf -o %:r.pdf --from=markdown+escaped_line_breaks -V geometry:margin=1in %"
+command Rr exec "!pandoc -t pdf -o %:r.pdf --from=markdown+escaped_line_breaks -V geometry:margin=1in %"
+
+"Auto-rerender markdown files to pdf
+autocmd BufWritePost *.mkd :Rd
diff --git a/users/ryan/zen/zenPolicies.nix b/users/ryan/zen/zenPolicies.nix
index edde27d..ad0627a 100644
--- a/users/ryan/zen/zenPolicies.nix
+++ b/users/ryan/zen/zenPolicies.nix
@@ -69,6 +69,7 @@ in
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
+ private_browsing = true;
};
# Bitwarden
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = {