Add some more stuff (#69)

This commit is contained in:
Patrick Stevens
2024-08-19 23:38:06 +01:00
committed by GitHub
parent ede76d2bc2
commit 5c872e2c4a
6 changed files with 68 additions and 50 deletions

View File

@@ -67,6 +67,26 @@ in {
RunAtLoad = true;
};
};
sync-nixpkgs = {
command = ''${pkgs.bash}/bin/bash -c "if [ -d /Users/patrick/Documents/GitHub/nixpkgs ] ; then ${pkgs.git}/bin/git --git-dir /Users/patrick/Documents/GitHub/nixpkgs/.git fetch origin ; fi"'';
serviceConfig = {
KeepAlive = false;
UserName = "patrick";
StartInterval = 36000;
RunAtLoad = true;
};
};
sync-dotnet-api-docs = {
command = ''${pkgs.bash}/bin/bash -c "if [ -d /Users/patrick/Documents/GitHub/dotnet-api-docs ] ; then ${pkgs.git}/bin/git --git-dir /Users/patrick/Documents/GitHub/dotnet-api-docs/.git fetch origin ; fi"'';
serviceConfig = {
KeepAlive = false;
UserName = "patrick";
StartInterval = 36000;
RunAtLoad = true;
};
};
};
# Auto upgrade nix package and the daemon service.

30
flake.lock generated
View File

@@ -27,11 +27,11 @@
]
},
"locked": {
"lastModified": 1722609272,
"narHash": "sha256-Kkb+ULEHVmk07AX+OhwyofFxBDpw+2WvsXguUS2m6e4=",
"lastModified": 1722924007,
"narHash": "sha256-+CQDamNwqO33REJLft8c26NbUi2Td083hq6SvAm2xkU=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "f7142b8024d6b70c66fd646e1d099d3aa5bfec49",
"rev": "91010a5613ffd7ee23ee9263213157a1c422b705",
"type": "github"
},
"original": {
@@ -50,11 +50,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1722874856,
"narHash": "sha256-h5I4R1iC7DT9osViQQRjxjwGbrJN7e2Ex5fYBSKc5SM=",
"lastModified": 1723686119,
"narHash": "sha256-IAqqmbLkL+EhmeD7VAAMRZmay9vSA/MF41RZmFFr/ws=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "cd006b0c4505ce610b8d6b67f6b4e92e9bd794e9",
"rev": "f396ad6b3ce6bfa2f3282cba4660df17391fd2a0",
"type": "github"
},
"original": {
@@ -121,11 +121,11 @@
]
},
"locked": {
"lastModified": 1722630065,
"narHash": "sha256-QfM/9BMRkCmgWzrPDK+KbgJOUlSJnfX4OvsUupEUZvA=",
"lastModified": 1723399884,
"narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "afc892db74d65042031a093adb6010c4c3378422",
"rev": "086f619dd991a4d355c07837448244029fc2d9ab",
"type": "github"
},
"original": {
@@ -164,11 +164,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1722651103,
"narHash": "sha256-IRiJA0NVAoyaZeKZluwfb2DoTpBAj+FLI0KfybBeDU0=",
"lastModified": 1723556749,
"narHash": "sha256-+CHVZnTnIYRLYsARInHYoWkujzcRkLY/gXm3s5bE52o=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a633d89c6dc9a2a8aae11813a62d7c58b2c0cc51",
"rev": "4a92571f9207810b559c9eac203d1f4d79830073",
"type": "github"
},
"original": {
@@ -180,11 +180,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1722730825,
"narHash": "sha256-X6U+w8qFBuGPCYrZzc9mpN34aRjQ8604MonpBUkj908=",
"lastModified": 1723603349,
"narHash": "sha256-VMg6N7MryOuvSJ8Sj6YydarnUCkL7cvMdrMcnsJnJCE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f3834de3782b82bfc666abf664f946d0e7d1f116",
"rev": "daf7bb95821b789db24fc1ac21f613db0c1bf2cb",
"type": "github"
},
"original": {

View File

@@ -135,6 +135,9 @@
{
plugin = nixpkgs.vimPlugins.mini-nvim;
}
{
plugin = nixpkgs.vimPlugins.satellite-nvim;
}
{
plugin = nixpkgs.vimPlugins.nvim-lightbulb;
type = "lua";
@@ -300,6 +303,8 @@
nixpkgs.gnupg
nixpkgs.gh
nixpkgs.clang-tools
nixpkgs.deno
nixpkgs.yazi
];
home.file.".ideavimrc".source = ./ideavimrc;

View File

@@ -74,12 +74,13 @@ function RegisterSolution(sln_path)
local whichkey = require("which-key")
whichkey.add({
s = {
name = ".NET solution",
b = { BuildDotNetSolution, "Build .NET solution" },
t = { TestDotNetSolution, "Test .NET solution" },
{
"<localleader>s",
desc = ".NET solution",
},
}, { prefix = vim.api.nvim_get_var("maplocalleader"), buffer = vim.api.nvim_get_current_buf() })
{ "<localleader>sb", BuildDotNetSolution, desc = "Build .NET solution" },
{ "<localleader>st", TestDotNetSolution, desc = "Test .NET solution" },
}, { buffer = vim.api.nvim_get_current_buf() })
end
local function find_nearest_slns()
@@ -153,7 +154,7 @@ vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "fsharp", "cs" },
pattern = { "fsharp", "cs", "fsharp_project" },
callback = function()
FindAndRegisterSolution(false)
end,
@@ -274,6 +275,7 @@ end
local function curl(url, callback)
local stdout = vim.uv.new_pipe(false)
local stdout_text = ""
local handle
handle, _ = vim.uv.spawn(
"_CURL_",
{ args = { "--silent", "--compressed", "--fail", url }, stdio = { nil, stdout, nil } },
@@ -326,6 +328,7 @@ local function populate_nuget_api(callback)
print(k .. ": " .. tostring(v))
end
callback()
return
end
local resourceSuccess, regUrl = find(resources, function(o)
@@ -629,7 +632,7 @@ local function prefetch_dependencies()
end
vim.api.nvim_create_autocmd("FileType", {
pattern = { "fsharp_project", "csharp_project" },
pattern = { "fsharp_project", "csharp_project", "xml" },
callback = function()
function UpdateNuGetVersion()
local line = vim.api.nvim_get_current_line()
@@ -709,12 +712,10 @@ vim.api.nvim_create_autocmd("FileType", {
:find()
end
local whichkey = require("which-key")
whichkey.register({
n = {
name = "NuGet",
u = { UpdateNuGetVersion, "Upgrade NuGet versions" },
},
}, { prefix = vim.api.nvim_get_var("maplocalleader"), buffer = vim.api.nvim_get_current_buf() })
whichkey.add({
{ "<localleader>n", desc = "NuGet" },
{ "<localleader>nu", UpdateNuGetVersion, desc = "Upgrade NuGet versions" },
}, { buffer = vim.api.nvim_get_current_buf() })
vim.schedule(prefetch_dependencies)
end,

View File

@@ -206,28 +206,19 @@ vim.api.nvim_create_autocmd("FileType", {
callback = function()
local status, whichkey = pcall(require, "which-key")
if status then
whichkey.register({
f = {
name = "F#",
t = { ":call fsharp#showTooltip()<CR>", "Show F# Tooltip" },
["si"] = { ":call fsharp#toggleFsi()<CR>", "Toggle FSI (F# Interactive)" },
["sl"] = { ":call fsharp#sendLineToFsi()<cr>", "Send line to FSI (F# Interactive)" },
r = {
name = "Run F# project",
d = { ":RunFSharpProject Debug", "Run F# project in debug configuration" },
r = { ":RunFSharpProject Release", "Run F# project in release configuration" },
},
p = {
":PublishFSharpProject",
"Publish F# project",
},
b = {
"Build F# project",
a = { BuildFSharpProjects, "Build all projects" },
s = { ":BuildFSharpProject", "Build specified project" },
},
},
}, { prefix = vim.api.nvim_get_var("maplocalleader"), buffer = vim.api.nvim_get_current_buf() })
whichkey.add({
{ "<localleader>f", desc = "F#" },
{ "<localleader>ft", ":call fsharp#showTooltip()<CR>", desc = "Show F# Tooltip" },
{ "<localleader>fsi", ":call fsharp#toggleFsi()<CR>", desc = "Toggle FSI (F# Interactive)" },
{ "<localleader>fsl", ":call fsharp#sendLineToFsi()<cr>", desc = "Send line to FSI (F# Interactive)" },
{ "<localleader>fr", desc = "Run F# project" },
{ "<localleader>frd", ":RunFSharpProject Debug", desc = "Run F# project in debug configuration" },
{ "<localleader>frr", ":RunFSharpProject Release", desc = "Run F# project in release configuration" },
{ "<localleader>fp", ":PublishFSharpProject", desc = "Publish F# project" },
{ "<localleader>fb", desc = "Build F# project" },
{ "<localleader>fba", BuildFSharpProjects, desc = "Build all projects" },
{ "<localleader>fbs", ":BuildFSharpProject", desc = "Build specified project" },
}, { buffer = vim.api.nvim_get_current_buf() })
else
vim.api.nvim_set_keymap("n", "<localleader>ft", ":call fsharp#showTooltip()<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<localleader>fsi", ":call fsharp#toggleFsi()<CR>", { noremap = true })

View File

@@ -43,6 +43,7 @@ require("lspconfig")["jsonls"].setup({
},
})
require("lspconfig")["denols"].setup({})
require("lspconfig")["bashls"].setup({})
require("lspconfig")["dockerls"].setup({})
require("lspconfig")["html"].setup({