3 Commits

Author SHA1 Message Date
Patrick Stevens
c1ca9a27e9 Remove coq in favour of nvim-cmp (#112) 2025-03-07 22:03:42 +00:00
Patrick Stevens
2a371ff957 Update Git config (#111) 2025-03-07 21:47:32 +00:00
Patrick Stevens
58c06a2a70 Update flake (#110) 2025-03-01 11:41:37 +00:00
9 changed files with 155 additions and 68 deletions

View File

@@ -1,8 +1,6 @@
{pkgs, ...}: let
mbsync = import ./mbsync.nix {inherit pkgs;};
in {
nix.useDaemon = true;
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
@@ -107,7 +105,6 @@ in {
};
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nix.package = pkgs.nixVersions.stable;
nix.gc.automatic = true;

42
flake.lock generated
View File

@@ -7,11 +7,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1737610453,
"narHash": "sha256-OLgl/kgjOmDFrkU04PlqVklXj1m9y8xF7xbD+blAdg8=",
"lastModified": 1738646237,
"narHash": "sha256-++0dXoZO9l5oceiGQsJmtUI5WXlPMw6QKjpg7vGPl3w=",
"owner": "tpwrules",
"repo": "nixos-apple-silicon",
"rev": "1f7bdbb82f6b9ec1d8d206e2c64d36f13bae91a1",
"rev": "3d1c6c27b14c4b8fcbdaec779e715f30cb72ed15",
"type": "github"
},
"original": {
@@ -27,11 +27,11 @@
]
},
"locked": {
"lastModified": 1737504076,
"narHash": "sha256-/B4XJnzYU/6K1ZZOBIgsa3K4pqDJrnC2579c44c+4rI=",
"lastModified": 1740755725,
"narHash": "sha256-amZbqP84H/ApugaT+TADXTB3NbjkVHI9Vac1saIk0kE=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "65cc1fa8e36ceff067daf6cfb142331f02f524d3",
"rev": "5d6e0851b60508cffd66b4a6982440a40720338d",
"type": "github"
},
"original": {
@@ -49,11 +49,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1737770462,
"narHash": "sha256-d+VpkYISLIBRvSFUCyPbpcanPCheC7THbW2cbgTlb/s=",
"lastModified": 1740820419,
"narHash": "sha256-Q0fbGgkpWyfadaXJmQmX+S+mF9cZSetYXZ+LQFwj0zE=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "1daea5ddf4cebd26c500f265edbeb62d679c7ff7",
"rev": "25b732c255ccb41258d70d775afb9f16e25fa3d5",
"type": "github"
},
"original": {
@@ -102,11 +102,11 @@
]
},
"locked": {
"lastModified": 1737762889,
"narHash": "sha256-5HGG09bh/Yx0JA8wtBMAzt0HMCL1bYZ93x4IqzVExio=",
"lastModified": 1740796616,
"narHash": "sha256-JU97wIfRxeFN6rpTsUVCwWAdix+Wka4Or23907YIrFI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "daf04c5950b676f47a794300657f1d3d14c1a120",
"rev": "f0b5e7e8a75abdea32bbff09ddd7b6eeb4b9b445",
"type": "github"
},
"original": {
@@ -129,11 +129,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1737469691,
"narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=",
"lastModified": 1738410390,
"narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab",
"rev": "3a228057f5b619feb3186e986dbe76278d707b6e",
"type": "github"
},
"original": {
@@ -145,11 +145,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1737672001,
"narHash": "sha256-YnHJJ19wqmibLQdUeq9xzE6CjrMA568KN/lFPuSVs4I=",
"lastModified": 1740743217,
"narHash": "sha256-brsCRzLqimpyhORma84c3W2xPbIidZlIc3JGIuQVSNI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "035f8c0853c2977b24ffc4d0a42c74f00b182cd8",
"rev": "b27ba4eb322d9d2bf2dc9ada9fd59442f50c8d7c",
"type": "github"
},
"original": {
@@ -161,11 +161,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1737717945,
"narHash": "sha256-ET91TMkab3PmOZnqiJQYOtSGvSTvGeHoegAv4zcTefM=",
"lastModified": 1740762151,
"narHash": "sha256-Rn0j0gP6po1m46RsW/4jrn7938TZGR+wRZ0+MSZThBg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ecd26a469ac56357fd333946a99086e992452b6a",
"rev": "5954d3359cc7178623da6c7fd23dc7f7504d7187",
"type": "github"
},
"original": {

View File

@@ -23,12 +23,14 @@
];
programs.vscode = {
userSettings = {
"lean.leanpkgPath" = "/Users/${username}/.elan/toolchains/stable/bin/leanpkg";
"lean.executablePath" = "/Users/${username}/.elan/toolchains/stable/bin/lean";
"lean.memoryLimit" = 16384;
"latex-workshop.view.pdf.viewer" = "tab";
"lean4.toolchainPath" = "/Users/${username}/.elan/toolchains/leanprover--lean4---nightly-2022-12-16";
profiles.default = {
userSettings = {
"lean.leanpkgPath" = "/Users/${username}/.elan/toolchains/stable/bin/leanpkg";
"lean.executablePath" = "/Users/${username}/.elan/toolchains/stable/bin/lean";
"lean.memoryLimit" = 16384;
"latex-workshop.view.pdf.viewer" = "tab";
"lean4.toolchainPath" = "/Users/${username}/.elan/toolchains/leanprover--lean4---nightly-2022-12-16";
};
};
};

28
home-manager/direnv/envrc Normal file
View File

@@ -0,0 +1,28 @@
# Configure Rider to use the correct .NET paths from an ambient .NET
use_rider_dotnet() {
# Get paths
DOTNET_PATH=$(readlink "$(which dotnet)")
SETTINGS_FILE=$(find . -maxdepth 1 -type f -name '*.sln.DotSettings.user')
MSBUILD=$(realpath "$(find "$(dirname "$DOTNET_PATH")/../share/dotnet/sdk" -maxdepth 2 -type f -name MSBuild.dll)")
# Update Rider settings if they exist
if [ -f "$SETTINGS_FILE" ] ; then
xmlstarlet ed --inplace \
-N wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" \
-N x="http://schemas.microsoft.com/winfx/2006/xaml" \
-N s="clr-namespace:System;assembly=mscorlib" \
-N ss="urn:shemas-jetbrains-com:settings-storage-xaml" \
--update "//s:String[@x:Key='/Default/Environment/Hierarchy/Build/BuildTool/DotNetCliExePath/@EntryValue']" \
--value "$(realpath "$(dirname "$DOTNET_PATH")/../share/dotnet/dotnet")" \
"$SETTINGS_FILE"
xmlstarlet ed --inplace \
-N wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" \
-N x="http://schemas.microsoft.com/winfx/2006/xaml" \
-N s="clr-namespace:System;assembly=mscorlib" \
-N ss="urn:shemas-jetbrains-com:settings-storage-xaml" \
--update "//s:String[@x:Key='/Default/Environment/Hierarchy/Build/BuildTool/CustomBuildToolPath/@EntryValue']" \
--value "$MSBUILD" \
"$SETTINGS_FILE"
fi
}

View File

@@ -76,6 +76,14 @@
push = {
default = "current";
autoSetupRemote = true;
followTags = true;
};
fetch = {
prune = true;
all = true;
};
help = {
autocorrect = "prompt";
};
pull = {
rebase = false;
@@ -83,6 +91,15 @@
init = {
defaultBranch = "main";
};
branch = {
sort = "-committerdate";
};
column = {
ui = "auto";
};
tag = {
sort = "version:refname";
};
advice = {
addIgnoredFile = false;
};
@@ -100,6 +117,8 @@
};
diff = {
colorMoved = "default";
algorithm = "histogram";
renames = true;
};
"protocol.file" = {
allow = "always";
@@ -109,22 +128,24 @@
programs.vscode = {
enable = true;
enableExtensionUpdateCheck = true;
enableUpdateCheck = true;
package = nixpkgs.vscode;
extensions = import ./vscode-extensions.nix {pkgs = nixpkgs;};
userSettings = {
workbench.colorTheme = "Default";
"files.Exclude" = {
"**/.git" = true;
"**/.DS_Store" = true;
"**/Thumbs.db" = true;
"**/*.olean" = true;
"**/result" = true;
profiles.default = {
extensions = import ./vscode-extensions.nix {pkgs = nixpkgs;};
enableExtensionUpdateCheck = true;
enableUpdateCheck = true;
userSettings = {
workbench.colorTheme = "Default";
"files.Exclude" = {
"**/.git" = true;
"**/.DS_Store" = true;
"**/Thumbs.db" = true;
"**/*.olean" = true;
"**/result" = true;
};
"git.path" = "${nixpkgs.git}/bin/git";
"update.mode" = "none";
"explorer.confirmDelete" = false;
};
"git.path" = "${nixpkgs.git}/bin/git";
"update.mode" = "none";
"explorer.confirmDelete" = false;
};
};
@@ -184,21 +205,6 @@
config = builtins.readFile ./nvim/roslyn-nvim.lua;
type = "lua";
}
{
plugin = let
name = "coq.artifacts";
rev = "9c5067a471322c6bb866545e88e5b28c82511865";
in
nixpkgs.vimUtils.buildVimPlugin {
name = name;
src = nixpkgs.fetchFromGitHub {
owner = "ms-jpq";
repo = name;
rev = rev;
hash = "sha256-BHm7U3pINtYamY7m26I4lQee7ccJ6AcHmYx7j1MRFDA=";
};
};
}
{
plugin = let
name = "venv-selector.nvim";
@@ -227,8 +233,12 @@
type = "lua";
}
{
plugin = nixpkgs.vimPlugins.coq_nvim;
config = ''let g:coq_settings = { 'auto_start': 'shut-up', 'xdg': v:true }'';
plugin = nixpkgs.vimPlugins.nvim-cmp;
config = builtins.readFile ./nvim/nvim-cmp.lua;
type = "lua";
}
{
plugin = nixpkgs.vimPlugins.cmp-nvim-lsp;
}
{
plugin = nixpkgs.vimPlugins.rustaceanvim;
@@ -306,12 +316,13 @@
nixpkgs.gopls
nixpkgs.go
nixpkgs.libiconv
nixpkgs.claude-code
]
++ (
if nixpkgs.stdenv.isLinux
then [
nixpkgs.ghostty
nixpkgs.xwaylandvideobridge
nixpkgs.kdePackages.xwaylandvideobridge
nixpkgs.protonmail-bridge
nixpkgs.pinentry
nixpkgs.signal-desktop

View File

@@ -6,5 +6,6 @@
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
# stdlib = builtins.readFile ../direnv/envrc;
};
}

View File

@@ -1,4 +1,4 @@
local coq = require("coq")
local nvim_cmp = require("cmp")
-- Using rustaceanvim means we shouldn't set up the LSP for Rust manually.
-- Similarly csharp_ls is unnecessary given roslyn.nvim
@@ -34,6 +34,8 @@ require("lspconfig")["yamlls"].setup({
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
capabilities.textDocument.completion.completionItem.snippetSupport = true
require("lspconfig")["jsonls"].setup({
capabilities = capabilities,
@@ -87,7 +89,8 @@ require("lspconfig")["lua_ls"].setup({
},
})
require("lspconfig").pyright.setup(coq.lsp_ensure_capabilities({
require("lspconfig").pyright.setup({
capabilities = capabilities,
handlers = {
["textDocument/publishDiagnostics"] = function(...)
vim.lsp.diagnostic.on_publish_diagnostics(...)
@@ -97,9 +100,10 @@ require("lspconfig").pyright.setup(coq.lsp_ensure_capabilities({
vim.api.nvim_set_current_win(window)
end,
},
}))
})
require("lspconfig").nil_ls.setup(coq.lsp_ensure_capabilities({
require("lspconfig").nil_ls.setup({
capabilities = capabilities,
settings = {
nix = {
flake = {
@@ -107,7 +111,7 @@ require("lspconfig").nil_ls.setup(coq.lsp_ensure_capabilities({
},
},
},
}))
})
function ToggleLocList()
local winid = vim.fn.getloclist(0, { winid = 0 }).winid

View File

@@ -0,0 +1,45 @@
local cmp = require("cmp")
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.snippet.expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
}, {
{ name = "buffer" },
}),
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
matching = { disallow_symbol_nonprefix_matching = false },
})

View File

@@ -12,7 +12,6 @@ with pkgs.vscode-extensions;
rust-lang.rust-analyzer
github.vscode-pull-request-github
shardulm94.trailing-spaces
nvarner.typst-lsp
arrterian.nix-env-selector
# Doesn't build on arm64
# vadimcn.vscode-lldb