From c60f15823b85a0e6e6655f8a74506e735cd3ef1c Mon Sep 17 00:00:00 2001 From: Ray Andrew Date: Wed, 20 Nov 2024 00:36:49 -0600 Subject: [PATCH] update --- src/home/email/mailcap.nix | 4 +- src/home/shell/default.nix | 1 + src/home/shell/git.nix | 34 +++++++-- src/home/shell/neovim/config/init.lua | 85 ++++++++++++--------- src/home/shell/neovim/config/lazy-lock.json | 3 +- src/home/ssh/config | 35 ++++++++- src/home/wm/common-i3.nix | 4 +- src/hosts/pickwick/default.nix | 2 +- src/nixos/stylix.nix | 4 +- src/nixos/xdg-portal.nix | 8 +- 10 files changed, 123 insertions(+), 57 deletions(-) diff --git a/src/home/email/mailcap.nix b/src/home/email/mailcap.nix index 116eaf9..e26f538 100644 --- a/src/home/email/mailcap.nix +++ b/src/home/email/mailcap.nix @@ -24,12 +24,14 @@ in # This second one is chosen by auto_view due to the copiousoutput tag text/html; ${w3m} -I %{charset} -T text/html -cols 140 -o tmp_dir=~/.cache/w3m -o display_link_number=1 -dump; copiousoutput - text/plain; vim %s + text/plain; nvim %s #PDFs application/x-pdf; ${zathura} '%s'; test=test -n "$DISPLAY" application/pdf; ${zathura} '%s'; test=test -n "$DISPLAY" + message/rfc822; nvim %s + #Images # image/png; /usr/bin/feh %s # image/jpeg; /usr/bin/feh %s diff --git a/src/home/shell/default.nix b/src/home/shell/default.nix index 7f465c6..c221b81 100644 --- a/src/home/shell/default.nix +++ b/src/home/shell/default.nix @@ -31,6 +31,7 @@ jq sd ugrep + unzip ] ++ (lib.attrValues config.custom.shell.packages); diff --git a/src/home/shell/git.nix b/src/home/shell/git.nix index cafc373..92abac1 100644 --- a/src/home/shell/git.nix +++ b/src/home/shell/git.nix @@ -4,11 +4,33 @@ config, ... }: +let + home = config.home.homeDirectory; +in { - home.packages = with pkgs; [ - git - ]; - # programs.git = { - # enable = true; - # }; + programs.git = { + enable = true; + lfs = { + enable = true; + }; + userEmail = "rs@rs.ht"; + userName = "Ray Andrew"; + signing.key = "${home}/.ssh/id_ed25519.pub"; + }; + + programs.gh = { + enable = true; + settings = { + git_protocol = "ssh"; + }; + extensions = with pkgs; [ + gh-copilot + ]; + }; + + custom.persist = { + home.files = [ + ".config/gh/hosts.yml" + ]; + }; } diff --git a/src/home/shell/neovim/config/init.lua b/src/home/shell/neovim/config/init.lua index a8c2344..1b1cd7c 100644 --- a/src/home/shell/neovim/config/init.lua +++ b/src/home/shell/neovim/config/init.lua @@ -322,7 +322,7 @@ require("lazy").setup({ -- Fuzzy find all the symbols in your current workspace. -- Similar to document symbols, except searches over your entire project. - map("ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols") + map("ps", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[P]roject [S]ymbols") -- Rename the variable under your cursor. -- Most Language Servers support renaming across files, etc. @@ -388,6 +388,7 @@ require("lazy").setup({ -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, + taplo = {}, lua_ls = { settings = { Lua = { @@ -400,6 +401,13 @@ require("lazy").setup({ }, } + + if vim.fn.executable('pip') == 1 then + vim.list_extend(servers, { + pylsp = {}, + }) + end + require("mason").setup() local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { @@ -415,6 +423,7 @@ require("lazy").setup({ require("lspconfig")[server_name].setup(server) end, }, + -- ensure_installed = ensure_installed, }) end, }, @@ -425,29 +434,30 @@ require("lazy").setup({ cmd = { "ConformInfo" }, keys = { { - "f", + "ff", function() require("conform").format({ async = true, lsp_format = "fallback" }) end, mode = "", - desc = "[F]ormat buffer", + desc = "[F]ile [F]ormat", }, }, opts = { notify_on_error = false, - format_on_save = function(bufnr) - local disable_filetypes = { c = true, cpp = true, python = true } - local lsp_format_opt - if disable_filetypes[vim.bo[bufnr].filetype] then - lsp_format_opt = "never" - else - lsp_format_opt = "fallback" - end - return { - timeout_ms = 500, - lsp_format = lsp_format_opt, - } - end, + format_on_save = nil, + -- format_on_save = function(bufnr) + -- local disable_filetypes = { c = true, cpp = true, python = true } + -- local lsp_format_opt + -- if disable_filetypes[vim.bo[bufnr].filetype] then + -- lsp_format_opt = "never" + -- else + -- lsp_format_opt = "fallback" + -- end + -- return { + -- timeout_ms = 500, + -- lsp_format = lsp_format_opt, + -- } + -- end, formatters_by_ft = { lua = { "stylua" }, python = { "isort", "black" }, @@ -568,29 +578,28 @@ require("lazy").setup({ -- end, -- }, - -- { - -- "ellisonleao/gruvbox.nvim", - -- priority = 1000, - -- opts = {}, - -- config = function(_, opts) - -- require("gruvbox").setup(opts) - -- vim.o.background = "dark" - -- vim.cmd.colorscheme("gruvbox") - -- end, - -- }, - { - "blazkowolf/gruber-darker.nvim", - priority = 1000, + "sainnhe/gruvbox-material", lazy = false, - opts = {}, - config = function(_, opts) - require("gruber-darker").setup(opts) - vim.cmd.colorscheme("gruber-darker") - vim.o.background = "dark" + priority = 1000, + config = function() + vim.g.gruvbox_material_enable_italic = true + vim.cmd.colorscheme("gruvbox-material") end, }, + -- { + -- "blazkowolf/gruber-darker.nvim", + -- priority = 1000, + -- lazy = false, + -- opts = {}, + -- config = function(_, opts) + -- require("gruber-darker").setup(opts) + -- vim.cmd.colorscheme("gruber-darker") + -- vim.o.background = "dark" + -- end, + -- }, + { -- Highlight todo, notes, etc in comments "folke/todo-comments.nvim", cmd = { "TodoTrouble", "TodoTelescope" }, @@ -1154,13 +1163,13 @@ local yank_relative_path = function() local path = MiniFiles.get_fs_entry().path path = vim.fn.fnamemodify(path, ":.") vim.fn.setreg("+", path) - vim.notify(path) + vim.notify("Copied: " .. path) end local yank_absolute_path = function() local path = MiniFiles.get_fs_entry().path vim.fn.setreg("+", path) - vim.notify(path) + vim.notify("Copied: " .. path) end local set_mark = function(id, path, desc) @@ -1187,5 +1196,9 @@ vim.api.nvim_create_autocmd("User", { end, }) +vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile", "BufWritePre" }, { + callback = require("mason-tool-installer").run_on_start, +}) + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/src/home/shell/neovim/config/lazy-lock.json b/src/home/shell/neovim/config/lazy-lock.json index 2370718..e753d62 100644 --- a/src/home/shell/neovim/config/lazy-lock.json +++ b/src/home/shell/neovim/config/lazy-lock.json @@ -7,7 +7,7 @@ "fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, "gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" }, - "gruber-darker.nvim": { "branch": "main", "commit": "a2dda61d9c1225e16951a51d6b89795b0ac35cd6" }, + "gruvbox-material": { "branch": "master", "commit": "170148af9350f578f3623f810e54698fa1e5bdbf" }, "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, "lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, "lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" }, @@ -24,6 +24,7 @@ "nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" }, "nvim-lspconfig": { "branch": "master", "commit": "f012c1b176f0e3c71f40eb309bdec0316689462e" }, "nvim-treesitter": { "branch": "master", "commit": "37427012d1c77c544356bfff0c9acc88fd3256bc" }, + "oil.nvim": { "branch": "master", "commit": "8ea40b5506115b6d355e304dd9ee5089f7d78601" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "snacks.nvim": { "branch": "main", "commit": "be8feef4ab584f50aaa96b69d50b3f86a35aacff" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, diff --git a/src/home/ssh/config b/src/home/ssh/config index ea2e64c..ff14fd1 100644 --- a/src/home/ssh/config +++ b/src/home/ssh/config @@ -57,6 +57,39 @@ Host polaris ControlPersist yes LogLevel FATAL +# LLNL + +Host lassen + ForwardX11Trusted yes + User sinurat1 + HostName lassen.llnl.gov + ControlMaster auto + ControlPersist yes + LogLevel FATAL + +Host corona + ForwardX11Trusted yes + User sinurat1 + HostName corona.llnl.gov + ControlMaster auto + ControlPersist yes + LogLevel FATAL + +Host czgitlab + HostName czgitlab.llnl.gov + ProxyCommand ssh oslic -W %h:7999 + ControlMaster no + User sinurat1 + +Host oslic + ForwardX11Trusted yes + Hostname oslic.llnl.gov + PreferredAuthentications password + User sinurat1 + ControlMaster auto + ControlPersist yes + LogLevel FATAL + # Box Host box @@ -148,7 +181,7 @@ Host cs-uc-07 # ControlPersist yes LogLevel FATAL ForwardAgent yes - ForwardX11 yes + # ForwardX11 yes Host ucare-gpu-1.cs.uchicago.edu ForwardAgent yes diff --git a/src/home/wm/common-i3.nix b/src/home/wm/common-i3.nix index 076b5bf..ea1e23f 100644 --- a/src/home/wm/common-i3.nix +++ b/src/home/wm/common-i3.nix @@ -150,8 +150,8 @@ in "${modifier}+s" = "layout stacking"; "${modifier}+t" = "layout tabbed"; "${modifier}+e" = "layout toggle split"; - "${modifier}+Shift+p" = "floating toggle"; - "${modifier}+p" = "focus mode_toggle"; + "${modifier}+p" = "floating toggle"; + "${modifier}+Shift+p" = "focus mode_toggle"; "${modifier}+f" = "fullscreen toggle"; "${modifier}+Shift+v" = "split v"; "${modifier}+v" = "split h"; diff --git a/src/hosts/pickwick/default.nix b/src/hosts/pickwick/default.nix index 31ad7d3..ae6ed76 100644 --- a/src/hosts/pickwick/default.nix +++ b/src/hosts/pickwick/default.nix @@ -50,7 +50,7 @@ sway.enable = false; }; gnome = { - enable = true; + enable = false; stylix = true; }; kde = { diff --git a/src/nixos/stylix.nix b/src/nixos/stylix.nix index 26b0bf8..a139b93 100644 --- a/src/nixos/stylix.nix +++ b/src/nixos/stylix.nix @@ -9,8 +9,8 @@ autoEnable = false; image = pkgs.nixos-artwork.wallpapers.nineish-dark-gray.src; # base16Scheme = "${pkgs.base16-schemes}/share/themes/atelier-forest.yaml"; - # base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-material-dark-hard.yaml"; - base16Scheme = "${pkgs.base16-schemes}/share/themes/gruber.yaml"; + base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-material-dark-hard.yaml"; + # base16Scheme = "${pkgs.base16-schemes}/share/themes/gruber.yaml"; polarity = "dark"; fonts = { serif = config.stylix.fonts.sansSerif; diff --git a/src/nixos/xdg-portal.nix b/src/nixos/xdg-portal.nix index 0d67a3d..863cc44 100644 --- a/src/nixos/xdg-portal.nix +++ b/src/nixos/xdg-portal.nix @@ -4,15 +4,9 @@ enable = true; # xdgOpenUsePortal = true; wlr.enable = true; - extraPortals = with pkgs; [ - # xdg-desktop-portal-kde - # xdg-desktop-portal-gnome + configPackages = with pkgs; [ xdg-desktop-portal-gtk ]; - # config = { - # common = { default = [ "gtk" ]; }; - # gnome = { default = [ "gnome" "gtk" ]; }; - # }; }; systemd.tmpfiles.rules = [