Compare commits

..

No commits in common. "248b7bf232f4e5f08cc4914eb1fb6ebbc8f92a33" and "2664a47219e9c7a6da5b2bb614cf5a6436476854" have entirely different histories.

9 changed files with 250 additions and 361 deletions

View File

@ -1,5 +0,0 @@
{
"diagnostics.disable": [
"missing-fields"
]
}

View File

@ -17,7 +17,7 @@ set -g default-terminal "screen-256color"
### example of some useful key-bindings
#bind-key "~" split-window "exec htop"
bind-key C-c copy-mode
bind-key "R" source-file ~/.tmux.conf
#bind-key "a" select-window -l
#bind-key "C-a" select-window -l

View File

@ -1,4 +1,3 @@
set -o vi
export PROMPT='%F{green}[%T] %F{cyan}(%n@%m) %F{lightgrey}(%y) %F{cyan} %~
%F{white}%(!.>>.$>) '

View File

@ -512,28 +512,9 @@
"nil-flake": "nil-flake",
"nixpkgs": "nixpkgs_5",
"nurl-flake": "nurl-flake",
"roslyn-lsp": "roslyn-lsp",
"runwhen-flake": "runwhen-flake",
"rust-overlay-flake": "rust-overlay-flake",
"sile-flake": "sile-flake",
"treesitter-context": "treesitter-context"
}
},
"roslyn-lsp": {
"flake": false,
"locked": {
"lastModified": 1704752101,
"narHash": "sha256-eWKAdrKfuBqSoOW70BSqcANrGQ+NwbmCL8C1jLXdNt8=",
"owner": "zaphar",
"repo": "roslyn.nvim",
"rev": "f1301be34ff786036867137228f3d9f65a3434af",
"type": "github"
},
"original": {
"owner": "zaphar",
"ref": "non_nightly",
"repo": "roslyn.nvim",
"type": "github"
"sile-flake": "sile-flake"
}
},
"runwhen-flake": {
@ -708,23 +689,6 @@
"repo": "default",
"type": "github"
}
},
"treesitter-context": {
"flake": false,
"locked": {
"lastModified": 1693236978,
"narHash": "sha256-B6BXeFEWxTFf46JrlatsxEQcC6+/hPIDBb5cIcJpLZg=",
"owner": "nvim-treesitter",
"repo": "nvim-treesitter-context",
"rev": "e6b743ccd4e780bc9cd85b707de67df72eea1a23",
"type": "github"
},
"original": {
"owner": "nvim-treesitter",
"repo": "nvim-treesitter-context",
"rev": "e6b743ccd4e780bc9cd85b707de67df72eea1a23",
"type": "github"
}
}
},
"root": "root",

View File

@ -23,11 +23,6 @@
url = "github:nvim-treesitter/nvim-treesitter-context/e6b743ccd4e780bc9cd85b707de67df72eea1a23";
flake = false;
};
# We need to pin to this version of treesitter because it breaks after this revision
roslyn-lsp = {
url = "github:zaphar/roslyn.nvim/non_nightly";
flake = false;
};
};
outputs = {
sile-flake,
@ -40,7 +35,6 @@
nurl-flake,
harpoon-src,
treesitter-context,
roslyn-lsp,
nixpkgs,
... # We don't use the self or nixpkgs args here so we just glob it.
}: {
@ -50,27 +44,41 @@
in
{ config, ...}: let
pkgs = nixPkgs;
nvim-treesitter-csharp = pkgs.callPackage ./nvim-treesitter-csharp.nix {
inherit (pkgs.tree-sitter) buildGrammar;
inherit (pkgs) fetchFromGitHub;
};
possession-nvim = pkgs.callPackage ./possession-nvim.nix {
inherit (pkgs.vimUtils) buildVimPlugin;
inherit (pkgs) fetchFromGitHub;
};
harpoon-nvim = pkgs.callPackage ./harpoon-nvim.nix {
inherit (pkgs.vimUtils) buildVimPlugin;
inherit (pkgs.vimUtils) buildVimPluginFrom2Nix;
harpoonSrc = harpoon-src;
};
nvim-treesitter-context = pkgs.vimUtils.buildVimPlugin {
nvim-treesitter-context = pkgs.vimUtils.buildVimPluginFrom2Nix {
name = "nvim-treesitter-context";
src = treesitter-context;
};
roslyn-nvim = pkgs.vimUtils.buildVimPlugin {
name = "roslyn-nvim";
src = roslyn-lsp;
};
# TODO(jwall): When this actually builds we should use it.
#nvim-treesitter-powershell = pkgs.callPackage ./nvim-powershell.nix {
# inherit (pkgs.tree-sitter) buildGrammar;
# inherit (pkgs) fetchFromGitHub;
#};
expected-parsers = (pkgs.lib.attrVals [
"tree-sitter-rust"
"tree-sitter-lua"
"tree-sitter-toml"
"tree-sitter-yaml"
"tree-sitter-json"
"tree-sitter-html"
"tree-sitter-css"
"tree-sitter-nix"
"tree-sitter-latex"
"tree-sitter-ocaml"
"tree-sitter-tlaplus"
"tree-sitter-julia"
] pkgs.tree-sitter.builtGrammars) ++ [nvim-treesitter-csharp];
in {
imports = [
./program-neovim.nix
@ -110,36 +118,11 @@ EOF";
#nvim-dap-ui
vimagit
hoon-vim
nvim-treesitter
roslyn-nvim
(nvim-treesitter.withPlugins (_: expected-parsers))
nvim-treesitter-context
nvim-treesitter-textobjects
nvim-treesitter-parsers.ini
nvim-treesitter-parsers.rust
nvim-treesitter-parsers.c
nvim-treesitter-parsers.c_sharp
nvim-treesitter-parsers.cpp
nvim-treesitter-parsers.clojure
nvim-treesitter-parsers.latex
nvim-treesitter-parsers.terraform
nvim-treesitter-parsers.hcl
nvim-treesitter-parsers.yaml
nvim-treesitter-parsers.lua
nvim-treesitter-parsers.vim
nvim-treesitter-parsers.go
nvim-treesitter-parsers.toml
nvim-treesitter-parsers.tlaplus
nvim-treesitter-parsers.typescript
nvim-treesitter-parsers.starlark
nvim-treesitter-parsers.python
nvim-treesitter-parsers.sql
nvim-treesitter-parsers.javascript
nvim-treesitter-parsers.ocaml
nvim-treesitter-parsers.haskell
nvim-treesitter-parsers.css
nvim-treesitter-parsers.promql
nvim-treesitter-parsers.nix
nvim-treesitter-parsers.hoon
omnisharp-extended-lsp-nvim
#neotest-dotnet
nix-develop-nvim
@ -165,7 +148,6 @@ EOF";
nil-pkg
lua-language-server
rust-analyzer
omnisharp-roslyn
]);
};
};
@ -198,30 +180,22 @@ EOF";
source = ./init.lua;
};
programs = {
zsh = {
enable = true; # default shell on catalina
programs = with pkgs; {
zsh.enable = true; # default shell on catalina
# This is a total hack but we don't want the default clobbering it which it does if it's an empty string or null
promptInit = "#noop";
interactiveShellInit = (builtins.readFile ./.zshrc);
};
tmux = {
enable = true;
enableVim = true;
extraConfig = (builtins.readFile ./tmux.conf);
};
zsh.promptInit = "#noop";
zsh.interactiveShellInit = (builtins.readFile ./.zshrc);
};
environment.systemPackages = (with pkgs; [
args.pkgs.isabelle
args.pkgs.terraform # TODO(jeremy): Replace with opentofu when that is an option.
tmux-sessionizer
consul
consul-template
nomad
postgresql
oha
nodejs
tmux
gnumake
# TODO find a version of the julia package that will install
# on darwin and add it as an overlay

View File

@ -1,5 +1,5 @@
{buildVimPlugin, harpoonSrc, ...}:
buildVimPlugin {
{buildVimPluginFrom2Nix, harpoonSrc, ...}:
buildVimPluginFrom2Nix {
name = "harpoon";
src = harpoonSrc;
}

View File

@ -91,13 +91,13 @@ cmp.setup({
sources = cmp.config.sources(
{
{ name = 'nvim_lsp', keyword_length = 3 }, -- from language server
{ name = 'nvim_lsp_signature_help' }, -- display function signatures with current parameter emphasized
{ name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized
},
{
{ name = 'path' }, -- file paths
},
{
{ name = 'nvim_lua', keyword_length = 2 }, -- complete neovim's Lua runtime API such vim.lsp.*
{ name = 'nvim_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.*
{ name = 'buffer', keyword_length = 2 }, -- source current buffer
{ name = 'vsnip', keyword_length = 2 }, -- nvim-cmp source for vim-vsnip
}),
@ -111,6 +111,8 @@ cmp.setup({
--vim.lsp.set_log_level('trace')
--vim.lsp.log.set_format_func(vim.inspect)
local roslyn_lsp_dll = vim.fs.normalize("~/bin/Microsoft.CodeAnalysis.LanguageServer.dll")
local caps = vim.tbl_deep_extend(
'force',
vim.lsp.protocol.make_client_capabilities(),
@ -120,16 +122,13 @@ local caps = vim.tbl_deep_extend(
{ workspace = { didChangeWatchedFiles = { dynamicRegistration = true } } },
{ window = { progress = false } }
);
vim.lsp.set_log_level(vim.log.levels.TRACE)
local lspconfig = require("lspconfig")
-- Terraform lsp setup
lspconfig.terraformls.setup {}
lspconfig.terraformls.setup{}
-- Nix language server support
lspconfig.nil_ls.setup {
lspconfig.nil_ls.setup{
--single_file_support = true,
--on_attach = function(client, bufnr)
-- -- disable the semanticTokens because it has issues.
@ -138,14 +137,6 @@ lspconfig.nil_ls.setup {
capabilities = caps,
}
--require('roslyn').setup({
-- on_attach = function (client, _)
-- --vim.notify(vim.inspect(client))
-- end,
-- capabilities = caps,
-- log_level = "Trace",
--});
local vim_pid = vim.fn.getpid()
-- "FormatterOptions:EnableEditorConfigSupport=true"
@ -179,39 +170,33 @@ lspconfig.omnisharp.setup {
}
--ocaml
lspconfig.ocamllsp.setup {
lspconfig.ocamllsp.setup{
capabilities = caps
}
-- Java language server support
lspconfig.java_language_server.setup {
lspconfig.java_language_server.setup{
capabilities = caps
}
-- Typescript language server support
lspconfig.tsserver.setup {
lspconfig.tsserver.setup{
capabilities = caps
}
-- Rust language server support
lspconfig.rust_analyzer.setup {
settings = {
-- https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/generated_config.adoc
['rust-analyzer'] = {
cargo = { features = "all" }
}
},
lspconfig.rust_analyzer.setup{
capabilities = caps
}
-- lua language server setup.
lspconfig.lua_ls.setup {
lspconfig.lua_ls.setup{
settings = {
Lua = {
runtime = { version = 'LuaJIT', },
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { 'vim' },
globals = {'vim'},
},
workspace = {
-- Make the server aware of Neovim runtime files
@ -234,7 +219,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
vim.keymap.set("n", '<C-Space>', function()
vim.lsp.buf.hover()
end, opts)
vim.keymap.set({ "n", "v" }, "<Leader>a", vim.lsp.buf.code_action, opts)
vim.keymap.set({"n", "v"}, "<Leader>a", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "<Leader>f", vim.lsp.buf.format, opts)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.server_capabilities.codelens then
@ -243,7 +228,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
end,
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'InsertLeave', 'CursorHold' }, {
vim.api.nvim_create_autocmd({'BufEnter', 'InsertLeave', 'CursorHold'}, {
callback = function(_)
local clients = vim.lsp.get_active_clients()
for cid = 1, #clients do
@ -264,10 +249,10 @@ local sign = function(opts)
})
end
sign({ name = 'DiagnosticSignError', text = '🔥' })
sign({ name = 'DiagnosticSignWarn', text = '⚠️' })
sign({ name = 'DiagnosticSignHint', text = '➡️' })
sign({ name = 'DiagnosticSignInfo', text = '🗒️' })
sign({name = 'DiagnosticSignError', text = '🔥'})
sign({name = 'DiagnosticSignWarn', text = '⚠️'})
sign({name = 'DiagnosticSignHint', text = '➡️'})
sign({name = 'DiagnosticSignInfo', text = '🗒️'})
vim.diagnostic.config({
virtual_text = false,
@ -295,10 +280,10 @@ autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
-- noselect: Do not select, force to select one from the menu
-- shortness: avoid showing extra messages when using completion
-- updatetime: set updatetime for CursorHold
vim.opt.completeopt = { 'menuone', 'noselect', 'noinsert' }
vim.opt.shortmess = vim.opt.shortmess + { c = true }
vim.opt.completeopt = {'menuone', 'noselect', 'noinsert'}
vim.opt.shortmess = vim.opt.shortmess + { c = true}
vim.api.nvim_set_option('updatetime', 300)
vim.opt.sessionoptions = { 'buffers', 'curdir', 'skiprtp', 'localoptions', 'terminal', 'tabpages' }
vim.opt.sessionoptions = {'buffers', 'curdir', 'skiprtp', 'localoptions', 'terminal', 'tabpages' }
-- Fixed column for diagnostics to appear
-- Show autodiagnostic popup on cursor hover_range
-- Goto previous / next diagnostic warning / error
@ -313,7 +298,7 @@ autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
require('nvim-treesitter.configs').setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
additional_vim_regex_highlighting=false,
},
--indent = { enable = true },
rainbow = {
@ -348,10 +333,10 @@ require('nvim-treesitter.configs').setup {
--},
}
require 'treesitter-context'.setup {
require'treesitter-context'.setup {
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
max_lines = 5, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 45, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
line_numbers = true,
multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
@ -370,7 +355,7 @@ vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
-- setup nvim-tree
require("nvim-tree").setup {
require("nvim-tree").setup{
hijack_unnamed_buffer_when_opening = true,
update_focused_file = {
enable = true,
@ -419,7 +404,7 @@ require("nvim-tree").setup {
},
}
require('trouble').setup {
require('trouble').setup{
icons = false,
signs = {
hint = "➡️",
@ -458,7 +443,7 @@ vim.keymap.set("n", "<Leader>mg", function()
vim.cmd("MagitOnly")
end)
require('possession').setup {
require('possession').setup{
commands = {
save = 'SSave',
load = 'SLoad',
@ -505,8 +490,10 @@ local harpoon = require('harpoon')
harpoon:setup()
-- telescope keymaps
vim.keymap.set("n", "<Leader>pl", telescope.extensions.possession.list)
vim.keymap.set("n", "<leader>ha", function() harpoon:list():append() end)
vim.keymap.set("n", "<leader>he", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set("n", "<leader>pl", telescope.extensions.possession.list)
vim.keymap.set("n", "<Leader>nff", telescope_builtins.fd)
vim.keymap.set("n", "<Leader>rl", telescope_builtins.lsp_references)
vim.keymap.set("n", "<Leader>rn", vim.lsp.buf.rename)
@ -514,17 +501,8 @@ vim.keymap.set("n", "<Leader>sl", telescope_builtins.lsp_workspace_symbols)
vim.keymap.set("n", "<Leader>dl", telescope_builtins.diagnostics)
vim.keymap.set("n", "<Leader>rg", telescope_builtins.live_grep)
vim.keymap.set("n", "<Leader>bl", function() telescope_builtins.buffers({}) end)
-- harpoon keymaps
vim.keymap.set("n", "<Leader>ha", function() harpoon:list():append() end)
vim.keymap.set("n", "<Leader>he", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set("n", "<Leader>hj", function() harpoon:list():prev() end)
vim.keymap.set("n", "<Leader>hk", function() harpoon:list():next() end)
-- codelens keymaps
vim.keymap.set("n", "<Leader>rr", vim.lsp.codelens.run)
-- debugging DAP keymaps
vim.keymap.set("n", "<Leader>tdb", function()
vim.cmd("DBUIToggle")
end)
@ -539,7 +517,7 @@ dap.adapters.lldb = {
dap.adapters.coreclr = {
type = 'executable',
command = '/run/current-system/sw/bin/netcoredbg',
args = { '--interpreter=vscode' }
args = {'--interpreter=vscode'}
}
dap.configurations.rust = {
@ -566,3 +544,4 @@ dap.configurations.cs = {
end,
},
}

View File

@ -6,8 +6,7 @@
# SEE: https://github.com/NixOS/nix/issues/4119#issuecomment-1734738812
settings.sandbox = "relaxed";
extraOptions = ''
experimental-features = nix-command flakes repl-flake
extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux
experimental-features = nix-command flakes
'';
};
@ -54,9 +53,6 @@
# programs.bash.enable = true; # default shell on catalina
# programs.fish.enable = true;
system.defaults = {
finder.AppleShowAllExtensions = true;
};
system.systemBuilderArgs = lib.mkIf (config.nix.settings.sandbox == "relaxed") {
sandboxProfile = ''
(allow file-read* file-write* process-exec mach-lookup (subpath "${builtins.storeDir}"))

54
nix/darwin/flake.lock generated
View File

@ -7,11 +7,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1694793763,
"narHash": "sha256-y6gTE1C9mIoSkymRYyzCmv62PFgy+hbZ5j8fuiQK5KI=",
"lastModified": 1690228878,
"narHash": "sha256-9Xe7JV0krp4RJC9W9W9WutZVlw6BlHTFMiUP/k48LQY=",
"owner": "ryantm",
"repo": "agenix",
"rev": "572baca9b0c592f71982fca0790db4ce311e3c75",
"rev": "d8c973fd228949736dedf61b7f8cc1ece3236792",
"type": "github"
},
"original": {
@ -29,7 +29,6 @@
"nil-flake": "nil-flake",
"nixpkgs": "nixpkgs_5",
"nurl-flake": "nurl-flake",
"roslyn-lsp": "roslyn-lsp",
"runwhen-flake": "runwhen-flake",
"rust-overlay-flake": "rust-overlay-flake",
"sile-flake": "sile-flake",
@ -37,12 +36,12 @@
},
"locked": {
"lastModified": 1,
"narHash": "sha256-Uat1zSsHZfJ0lf1Ya9aW8r0mjBNtbt8woaSmHNyDGRA=",
"path": "/nix/store/4kzm062qwsfzq1vza029ic4lx9zpdy8p-source/nix/base-system",
"narHash": "sha256-h8APs3KV8oU8sWYFEpSpqFjqJ/QY2a2L90BDfad5VUo=",
"path": "/nix/store/0jd7ginq0vz1gglni90j5bzj4bk4ly7q-source/nix/base-system",
"type": "path"
},
"original": {
"path": "/nix/store/4kzm062qwsfzq1vza029ic4lx9zpdy8p-source/nix/base-system",
"path": "/nix/store/0jd7ginq0vz1gglni90j5bzj4bk4ly7q-source/nix/base-system",
"type": "path"
}
},
@ -325,11 +324,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1694797768,
"narHash": "sha256-CA9AQ+lvgbCOfH++A0rHKguTBBn0EEcVRLMAmkDecQo=",
"lastModified": 1693791390,
"narHash": "sha256-FnT7/iDcGLWSmzwDfD7RQwr7z5+U2j7YOqhR3UM3zrg=",
"owner": "martinvonz",
"repo": "jj",
"rev": "e288a152d052a531e0ccb25ae27ce07412d65447",
"rev": "e3c85d6ecc20ee4240cdf3ed80107ce7dc268abe",
"type": "github"
},
"original": {
@ -550,11 +549,11 @@
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1701273941,
"narHash": "sha256-MwDKOU2JZRHObIJLFbge+XS3ov54dAlDGtzWPtq7/PE=",
"lastModified": 1695751852,
"narHash": "sha256-4jG+8LPHteAAEfUOtlwK0piK79fQsAMp/SA6Lpob+JQ=",
"owner": "nix-community",
"repo": "nurl",
"rev": "caf9e815a036eec02eac877798ebc9b379adc810",
"rev": "715246bc9748cf196dafc7795812dec825e30b4b",
"type": "github"
},
"original": {
@ -569,23 +568,6 @@
"darwin": "darwin_2"
}
},
"roslyn-lsp": {
"flake": false,
"locked": {
"lastModified": 1704752101,
"narHash": "sha256-eWKAdrKfuBqSoOW70BSqcANrGQ+NwbmCL8C1jLXdNt8=",
"owner": "zaphar",
"repo": "roslyn.nvim",
"rev": "f1301be34ff786036867137228f3d9f65a3434af",
"type": "github"
},
"original": {
"owner": "zaphar",
"ref": "non_nightly",
"repo": "roslyn.nvim",
"type": "github"
}
},
"runwhen-flake": {
"inputs": {
"flake-compat": "flake-compat_2",
@ -642,11 +624,11 @@
]
},
"locked": {
"lastModified": 1694743934,
"narHash": "sha256-4pn0x+OiOFWefBpgyufFVaAeG+LwfVUI/HMCma8xdHU=",
"lastModified": 1693793487,
"narHash": "sha256-MS6CDyAC0sJMTE/pRYlfrhBnhlAPvEo43ipwf5ZNzHg=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "6a26dd6da9b4f28d9b4c397bd22b5df4bec8f78a",
"rev": "f179280eed5eb93759c94bf3231fbbda28f894b7",
"type": "github"
},
"original": {
@ -691,11 +673,11 @@
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1694595810,
"narHash": "sha256-tqeteJwXs77NOoSw3jwQu4ImP8wH+omEwNq6MZycrDM=",
"lastModified": 1692759315,
"narHash": "sha256-nRA6Oad/CwUdMXlHpv1wW1IY5Pp100BJvIscd1AlYbI=",
"owner": "sile-typesetter",
"repo": "sile",
"rev": "770d2b9f68297bb5e9ce75182bf6e57ae1cce3b9",
"rev": "fa84d15c902df4859caff8af8325097022b62f3e",
"type": "github"
},
"original": {