1
0
Fork 0

Various fixes

This commit is contained in:
Daniel Kempkens 2023-07-05 23:55:20 +02:00
parent b5fc4465b4
commit e5c390431d
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
8 changed files with 39 additions and 38 deletions

View file

@ -28,6 +28,7 @@ jobs:
- run: nix build '.#nixosConfigurations.tanker.pkgs.attic-server' - run: nix build '.#nixosConfigurations.tanker.pkgs.attic-server'
- run: nix build '.#nixosConfigurations.tanker.pkgs.attic-client' - run: nix build '.#nixosConfigurations.tanker.pkgs.attic-client'
- run: nix build '.#nixosConfigurations.tanker.pkgs.deploy-rs' - run: nix build '.#nixosConfigurations.tanker.pkgs.deploy-rs'
- run: nix build '.#nixosConfigurations.tanker.config.services.nginx.package'
- run: nix build '.#nixosConfigurations.tanker.config.home-manager.users.daniel.programs.neovim.finalPackage' - run: nix build '.#nixosConfigurations.tanker.config.home-manager.users.daniel.programs.neovim.finalPackage'
build-arm64-linux: build-arm64-linux:
@ -42,4 +43,5 @@ jobs:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build '.#nixosConfigurations.argon.pkgs.attic-client' - run: nix build '.#nixosConfigurations.argon.pkgs.attic-client'
- run: nix build '.#nixosConfigurations.argon.pkgs.deploy-rs' - run: nix build '.#nixosConfigurations.argon.pkgs.deploy-rs'
- run: nix build '.#nixosConfigurations.argon.config.services.nginx.package'
- run: nix build '.#nixosConfigurations.argon.config.home-manager.users.daniel.programs.neovim.finalPackage' - run: nix build '.#nixosConfigurations.argon.config.home-manager.users.daniel.programs.neovim.finalPackage'

View file

@ -71,7 +71,6 @@ in
mosquittoPorts = [ 1883 ]; mosquittoPorts = [ 1883 ];
in in
{ {
"enp41s0".allowedTCPPorts = mosquittoPorts;
"tailscale0".allowedTCPPorts = mosquittoPorts; "tailscale0".allowedTCPPorts = mosquittoPorts;
"podman+".allowedTCPPorts = mosquittoPorts; "podman+".allowedTCPPorts = mosquittoPorts;
}; };

View file

@ -324,11 +324,11 @@
"weewx-proxy-flake": "weewx-proxy-flake" "weewx-proxy-flake": "weewx-proxy-flake"
}, },
"locked": { "locked": {
"lastModified": 1688545452, "lastModified": 1688571825,
"narHash": "sha256-atZwF9M6GQPJBFvYdH7ErT5do4HW2ZJU8TudQVzvs4k=", "narHash": "sha256-ZFT6aMYVsosc2O0ogcGS2ykG21bFkFrhpGeMf719rYs=",
"owner": "nifoc", "owner": "nifoc",
"repo": "nix-overlay", "repo": "nix-overlay",
"rev": "5d3b73d5b2dae72e8d27da72e488e51db6f045ba", "rev": "1a3bd2e604228eafbb01fd867c032139fb2cbc93",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -88,7 +88,7 @@
(keymap.set :n :<leader>tw (keymap.set :n :<leader>tw
#(telescope-builtin.lsp_dynamic_workspace_symbols telescope-dropdown) #(telescope-builtin.lsp_dynamic_workspace_symbols telescope-dropdown)
{:buffer bufnr :desc "LSP Workspace Symbols"}) {:buffer bufnr :desc "LSP Workspace Symbols"})
(keymap.set :n :<leader>th #(vim.lsp.buf.inlay_hint bufnr nil) (keymap.set :n :<leader>th #(vim.lsp.inlay_hint bufnr nil)
{:buffer bufnr :desc "Toggle Inlay Hints"}) {:buffer bufnr :desc "Toggle Inlay Hints"})
(keymap.set :n :<leader>lca (keymap.set :n :<leader>lca
#(telescope-builtin.lsp_code_actions telescope-dropdown) #(telescope-builtin.lsp_code_actions telescope-dropdown)

View file

@ -1,5 +1,5 @@
(let [mod {} (let [mod {}
cache {} cache {:diagnostics {} :gitsigns {}}
api vim.api api vim.api
o vim.opt o vim.opt
b vim.b b vim.b
@ -11,14 +11,15 @@
aucmd vim.api.nvim_create_autocmd] aucmd vim.api.nvim_create_autocmd]
;; Cache ;; Cache
(fn maybe-setup-buffer-cache! [bufnr key] (fn cached-sign [key bufnr lnum]
(when (= (. cache bufnr) nil) (?. cache key bufnr lnum))
(tset cache bufnr {}))
(when (= (. cache bufnr key) nil)
(tset cache bufnr key {})))
(fn clear-cache! [bufnr key] (fn maybe-setup-buffer-cache! [key bufnr]
(tset cache bufnr key {})) (when (= (. cache key bufnr) nil)
(tset cache key bufnr {})))
(fn clear-cache! [key bufnr]
(tset cache key bufnr {}))
(fn cache-filter [func t] (fn cache-filter [func t]
(let [ret-tab {}] (let [ret-tab {}]
@ -26,40 +27,36 @@
ret-tab)) ret-tab))
(fn clear-diagnostics-cache! [bufnr diagnostics] (fn clear-diagnostics-cache! [bufnr diagnostics]
(let [key :diagnostics (let [namespaces (vim.tbl_map #$1.namespace diagnostics)
namespaces (vim.tbl_map #$1.namespace diagnostics) current-cache (. cache :diagnostics bufnr)
current-cache (. cache bufnr key)
new-cache (cache-filter #(not (vim.tbl_contains namespaces $1.ns)) new-cache (cache-filter #(not (vim.tbl_contains namespaces $1.ns))
current-cache)] current-cache)]
(tset cache bufnr key new-cache))) (tset cache :diagnostics bufnr new-cache)))
(fn update-cache-diagnostics [bufnr diagnostics] (fn update-cache-diagnostics [bufnr diagnostics]
(maybe-setup-buffer-cache! bufnr :diagnostics) (maybe-setup-buffer-cache! :diagnostics bufnr)
(clear-diagnostics-cache! bufnr diagnostics) (clear-diagnostics-cache! bufnr diagnostics)
(each [_ diagnostic (pairs diagnostics)] (each [_ diagnostic (pairs diagnostics)]
(let [lnum (+ diagnostic.lnum 1) (let [lnum (+ diagnostic.lnum 1)
current (. cache bufnr :diagnostics lnum)] current (cached-sign :diagnostics bufnr lnum)]
(when (or (= current nil) (> diagnostic.severity current.severity)) (when (or (= current nil) (> diagnostic.severity current.severity))
(tset cache bufnr :diagnostics lnum (tset cache :diagnostics bufnr lnum
{:severity diagnostic.severity {:severity diagnostic.severity
:col diagnostic.col :col diagnostic.col
:ns diagnostic.namespace}))))) :ns diagnostic.namespace})))))
(fn update-cache-gitsigns [bufnr] (fn update-cache-gitsigns [bufnr]
(maybe-setup-buffer-cache! bufnr :gitsigns) (maybe-setup-buffer-cache! :gitsigns bufnr)
(clear-cache! bufnr :gitsigns) (clear-cache! :gitsigns bufnr)
(let [signs (?. (vim.fn.sign_getplaced bufnr (let [signs (?. (vim.fn.sign_getplaced bufnr
{:group :gitsigns_vimfn_signs_}) {:group :gitsigns_vimfn_signs_})
1 :signs)] 1 :signs)]
(when (not= signs nil) (when (not= signs nil)
(each [_ sign (pairs signs)] (each [_ sign (pairs signs)]
(let [lnum sign.lnum (let [lnum sign.lnum
current (. cache bufnr :gitsigns lnum)] current (cached-sign :gitsigns bufnr lnum)]
(when (= current nil) (when (= current nil)
(tset cache bufnr :gitsigns lnum sign))))))) (tset cache :gitsigns bufnr lnum sign)))))))
(fn cached-sign [bufnr key lnum]
(?. cache bufnr key lnum))
(aucmd :DiagnosticChanged (aucmd :DiagnosticChanged
{:callback #(update-cache-diagnostics $1.buf $1.data.diagnostics) {:callback #(update-cache-diagnostics $1.buf $1.data.diagnostics)
@ -69,8 +66,10 @@
:callback #(update-cache-gitsigns $1.buf) :callback #(update-cache-gitsigns $1.buf)
:group augroup :group augroup
:desc "Update cached gitsigns signs"}) :desc "Update cached gitsigns signs"})
(aucmd :BufWipeout (aucmd [:BufWipeout :BufWritePre]
{:callback #(tset cache $1.buf nil) {:callback (fn [args]
(tset cache :diagnostics args.buf nil)
(tset cache :gitsigns args.buf nil))
:group augroup :group augroup
:desc "Clear sign cache for current buffer"}) :desc "Clear sign cache for current buffer"})
;; Line Number ;; Line Number
@ -90,7 +89,7 @@
(set mod.gitsigns {:condition #(= b.nifoc_gitsigns_enabled 1) (set mod.gitsigns {:condition #(= b.nifoc_gitsigns_enabled 1)
:init (fn [self] :init (fn [self]
(let [bufnr (api.nvim_get_current_buf) (let [bufnr (api.nvim_get_current_buf)
sign (cached-sign bufnr :gitsigns v.lnum)] sign (cached-sign :gitsigns bufnr v.lnum)]
(set self.sign sign) (set self.sign sign)
(set self.has_sign (not= sign nil)))) (set self.has_sign (not= sign nil))))
:provider " ▏" :provider " ▏"
@ -123,7 +122,7 @@
diagnostic.severity.HINT :DiagnosticSignHint}} diagnostic.severity.HINT :DiagnosticSignHint}}
:init (fn [self] :init (fn [self]
(let [bufnr (api.nvim_get_current_buf) (let [bufnr (api.nvim_get_current_buf)
sign (cached-sign bufnr :diagnostics v.lnum)] sign (cached-sign :diagnostics bufnr v.lnum)]
(set self.sign sign) (set self.sign sign)
(set self.has_sign (not= sign nil)))) (set self.has_sign (not= sign nil))))
:provider #(if $1.has_sign :provider #(if $1.has_sign

View file

@ -6,10 +6,10 @@
augroup (vim.api.nvim_create_augroup :NifocLsp {:clear true}) augroup (vim.api.nvim_create_augroup :NifocLsp {:clear true})
aucmd vim.api.nvim_create_autocmd] aucmd vim.api.nvim_create_autocmd]
(fn setup-inlay-hint-toggle [bufnr] (fn setup-inlay-hint-toggle [bufnr]
(aucmd :InsertEnter {:callback #(vim.lsp.buf.inlay_hint bufnr false) (aucmd :InsertEnter {:callback #(vim.lsp.inlay_hint bufnr false)
:buffer bufnr :buffer bufnr
:group augroup}) :group augroup})
(aucmd :InsertLeave {:callback #(vim.lsp.buf.inlay_hint bufnr true) (aucmd :InsertLeave {:callback #(vim.lsp.inlay_hint bufnr true)
:buffer bufnr :buffer bufnr
:group augroup})) :group augroup}))
@ -20,7 +20,7 @@
(when (client.supports_method :textDocument/documentSymbol) (when (client.supports_method :textDocument/documentSymbol)
(navic.attach client bufnr)) (navic.attach client bufnr))
(when (client.supports_method :textDocument/inlayHint) (when (client.supports_method :textDocument/inlayHint)
(vim.lsp.buf.inlay_hint bufnr true) (vim.lsp.inlay_hint bufnr true)
(setup-inlay-hint-toggle bufnr)) (setup-inlay-hint-toggle bufnr))
(diagnostic.maybe-enable-lsp client bufnr) (diagnostic.maybe-enable-lsp client bufnr)
(formatting.maybe-enable-lsp client bufnr))) (formatting.maybe-enable-lsp client bufnr)))

View file

@ -111,8 +111,8 @@ in
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "nvim-treesitter"; owner = "nvim-treesitter";
repo = "nvim-treesitter"; repo = "nvim-treesitter";
rev = "0b81ed9f18333949a74586a1ea0497ae4cbb7cd4"; rev = "1bf573896c7854ca5827074685cd53e81eb30cef";
sha256 = "1bfz64fg0zc9mckd9gqjh098c688aja1422wd0znfgm68w30n3b7"; sha256 = "1c7af7r9a7kjijwj2j17rhnc2szs2q2ggrrcjqs4nnkkwxlsxf8g";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -301,8 +301,8 @@ in
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "L3MON4D3"; owner = "L3MON4D3";
repo = "LuaSnip"; repo = "LuaSnip";
rev = "db0aba4a39b28ff5564def07c25bb4bd06a78fdc"; rev = "a658ae2906344a1d2b9c507738e585cf68e685c7";
sha256 = "16khnc2zakxfiy6ikdd5afyfp0knplw3l95adzb98m61h4cvfnhi"; sha256 = "1ffrm03aq6xnxm8jh34m81qr3s5hfx2idbyvmi1kgfqgv8h5azdl";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };

View file

@ -8,6 +8,7 @@
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedGzipSettings = true; recommendedGzipSettings = true;
recommendedBrotliSettings = true; recommendedBrotliSettings = true;
recommendedZstdSettings = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
commonHttpConfig = '' commonHttpConfig = ''