From d7cdc05b3d22e838c985b7a64dc0e00d2ab0f39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 12 Aug 2023 09:43:13 +0200 Subject: [PATCH 01/11] refator(nvim): move neodev config to seperate file --- modules/programs/nvim/plugins/default.nix | 11 +---------- modules/programs/nvim/plugins/neodev-nvim.lua | 8 ++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 modules/programs/nvim/plugins/neodev-nvim.lua diff --git a/modules/programs/nvim/plugins/default.nix b/modules/programs/nvim/plugins/default.nix index 68088b8..7e61acc 100644 --- a/modules/programs/nvim/plugins/default.nix +++ b/modules/programs/nvim/plugins/default.nix @@ -132,16 +132,7 @@ with builtins; } { plugin = neodev-nvim; - conf = /* lua */ '' - require("neodev").setup({ - override = function(root_dir, library) - if root_dir:find("/home/moritz/.dotfiles/", 1, true) == 1 then - library.enabled = true - library.plugins = true - end - end, - }) - ''; + conf = readFile ./neodev-nvim.lua; } ]; } diff --git a/modules/programs/nvim/plugins/neodev-nvim.lua b/modules/programs/nvim/plugins/neodev-nvim.lua new file mode 100644 index 0000000..a63e89a --- /dev/null +++ b/modules/programs/nvim/plugins/neodev-nvim.lua @@ -0,0 +1,8 @@ +require("neodev").setup({ + override = function(root_dir, library) + if root_dir:find("/home/moritz/.dotfiles/", 1, true) == 1 then + library.enabled = true + library.plugins = true + end + end, +}) From 20e9a91d91bc2239d49d7364a8a1261ad473e065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 12 Aug 2023 11:50:46 +0200 Subject: [PATCH 02/11] feat(nvim): improve ufo --- modules/programs/nvim/plugins/default.nix | 3 +- .../programs/nvim/plugins/nvim-lspconfig.lua | 51 ++-------- modules/programs/nvim/plugins/nvim-ufo.lua | 98 +++++++++++++++++++ 3 files changed, 110 insertions(+), 42 deletions(-) create mode 100644 modules/programs/nvim/plugins/nvim-ufo.lua diff --git a/modules/programs/nvim/plugins/default.nix b/modules/programs/nvim/plugins/default.nix index 7e61acc..3118eb9 100644 --- a/modules/programs/nvim/plugins/default.nix +++ b/modules/programs/nvim/plugins/default.nix @@ -111,7 +111,7 @@ with builtins; } { plugin = nvim-lspconfig; - event = [ "BufReadPre" "BufNewFile" ]; + event = [ "BufRead" "BufNewFile" ]; conf = readFile ./nvim-lspconfig.lua; dependencies = [ { @@ -126,6 +126,7 @@ with builtins; { plugin = lsp_lines-nvim; } { plugin = nvim-ufo; + conf = readFile ./nvim-ufo.lua; dependencies = [ { plugin = promise-async; } ]; diff --git a/modules/programs/nvim/plugins/nvim-lspconfig.lua b/modules/programs/nvim/plugins/nvim-lspconfig.lua index 7fbc917..81a1421 100644 --- a/modules/programs/nvim/plugins/nvim-lspconfig.lua +++ b/modules/programs/nvim/plugins/nvim-lspconfig.lua @@ -5,58 +5,27 @@ vim.diagnostic.config({ virtual_text = false, }) -vim.o.foldcolumn = "1" -- '0' is not bad -vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value -vim.o.foldlevelstart = 99 -vim.o.foldenable = true -vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] -vim.o.statuscolumn = "%= " - -- FIXME: figure out how to put on the other side without having to do a lot of shifting - .. "%s" -- sign column - .. "%{%" -- evaluate this, and then evaluate what it returns - .. "&number ?" - .. "(v:relnum ?" - -- when showing relative numbers, make sure to pad so things don't shift as you move the cursor - .. 'printf("%"..len(line("$")).."s", v:relnum)' - .. ":" - .. "v:lnum" - .. ")" - .. ":" - .. '""' - .. " " -- space between lines and fold - .. "%}" - .. "%= " - .. "%#FoldColumn#" -- highlight group for fold - .. "%{" -- expression for showing fold expand/colapse - .. "foldlevel(v:lnum) > foldlevel(v:lnum - 1)" -- any folds? - .. "? (foldclosed(v:lnum) == -1" -- currently open? - .. '? ""' -- point down - .. ': ""' -- point to right - .. ")" - .. ': " "' -- blank for no fold, or inside fold - .. "}" - .. "%= " -- spacing between end of column and start of text - --- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself -require("which-key").register({ - z = { - R = { require("ufo").openAllFolds, "Open all folds" }, - M = { require("ufo").closeAllFolds, "Close all folds" }, - }, -}) local capabilities = vim.lsp.protocol.make_client_capabilities() +-- NOTE for nvim-ufo -- Tell the server the capability of foldingRange, -- Neovim hasn't added foldingRange to default capabilities, users must add it manually capabilities.textDocument.foldingRange = { dynamicRegistration = false, lineFoldingOnly = true, } -require("ufo").setup() local lspconfig = require("lspconfig") local on_attach_def = function(client, bufnr) require("which-key").register({ - K = { vim.lsp.buf.hover, "Hover" }, + K = { + function() + local winid = require("ufo").peekFoldedLinesUnderCursor() + if not winid then + vim.lsp.buf.hover() + end + end, + "Hover", + }, [""] = { l = { d = { vim.diagnostic.open_float, "Open diagnostic window" }, diff --git a/modules/programs/nvim/plugins/nvim-ufo.lua b/modules/programs/nvim/plugins/nvim-ufo.lua new file mode 100644 index 0000000..3bdedeb --- /dev/null +++ b/modules/programs/nvim/plugins/nvim-ufo.lua @@ -0,0 +1,98 @@ +vim.o.foldcolumn = "1" -- '0' is not bad +vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value +vim.o.foldlevelstart = 99 +vim.o.foldenable = true +vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] +vim.o.statuscolumn = "%s" -- sign column + .. "%=" + .. "%{%" -- evaluate this, and then evaluate what it returns + .. "&number ?" + .. "(v:relnum ?" + -- when showing relative numbers, make sure to pad so things don't shift as you move the cursor + .. 'printf("%"..len(line("$")).."s", v:relnum)' + .. ":" + .. "v:lnum" + .. ")" + .. ":" + .. '""' + .. "%}" + .. "%#FoldColumn#" -- highlight group for fold + .. "%{" -- expression for showing fold expand/colapse + .. "foldlevel(v:lnum) > foldlevel(v:lnum - 1)" -- any folds? + .. "? (foldclosed(v:lnum) == -1" -- currently open? + .. '? ""' -- point down + .. ': ""' -- point to right + .. ")" + .. ': " "' -- blank for no fold, or inside fold + .. "}" + .. " " + +local ftMap = { + vim = "indent", + python = { "indent" }, + git = "", +} + +---@param bufnr number +---@return Promise +local function customizeSelector(bufnr) + local function handleFallbackException(err, providerName) + if type(err) == "string" and err:match("UfoFallbackException") then + return require("ufo").getFolds(bufnr, providerName) + else + return require("promise").reject(err) + end + end + + return require("ufo") + .getFolds(bufnr, "lsp") + :catch(function(err) + return handleFallbackException(err, "treesitter") + end) + :catch(function(err) + return handleFallbackException(err, "indent") + end) +end + +local handler = function(virtText, lnum, endLnum, width, truncate) + local newVirtText = {} + local suffix = ("  %d "):format(endLnum - lnum) + local sufWidth = vim.fn.strdisplaywidth(suffix) + local targetWidth = width - sufWidth + local curWidth = 0 + for _, chunk in ipairs(virtText) do + local chunkText = chunk[1] + local chunkWidth = vim.fn.strdisplaywidth(chunkText) + if targetWidth > curWidth + chunkWidth then + table.insert(newVirtText, chunk) + else + chunkText = truncate(chunkText, targetWidth - curWidth) + local hlGroup = chunk[2] + table.insert(newVirtText, { chunkText, hlGroup }) + chunkWidth = vim.fn.strdisplaywidth(chunkText) + -- str width returned from truncate() may less than 2nd argument, need padding + if curWidth + chunkWidth < targetWidth then + suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth) + end + break + end + curWidth = curWidth + chunkWidth + end + table.insert(newVirtText, { suffix, "MoreMsg" }) + return newVirtText +end + +require("ufo").setup({ + provider_selector = function(_, filetype, _) + return ftMap[filetype] or customizeSelector + end, + fold_virt_text_handler = handler, +}) + +-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself +require("which-key").register({ + z = { + R = { require("ufo").openAllFolds, "Open all folds" }, + M = { require("ufo").closeAllFolds, "Close all folds" }, + }, +}) From 7d1ae8c1f4c3280b20a724f5dc68181ca3ad30db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 12 Aug 2023 16:46:45 +0200 Subject: [PATCH 03/11] feat(nvim): add inc-rename.nvim --- modules/programs/nvim/plugins/default.nix | 13 +++++++++++++ modules/programs/nvim/plugins/nvim-lspconfig.lua | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/programs/nvim/plugins/default.nix b/modules/programs/nvim/plugins/default.nix index 3118eb9..55ba586 100644 --- a/modules/programs/nvim/plugins/default.nix +++ b/modules/programs/nvim/plugins/default.nix @@ -135,6 +135,19 @@ with builtins; plugin = neodev-nvim; conf = readFile ./neodev-nvim.lua; } + { + plugin = inc-rename-nvim; + conf = /* lua */ '' + require("inc_rename").setup { + input_buffer_type = "dressing", + } + ''; + dependencies = [ + { + plugin = dressing-nvim; + } + ]; + } ]; } { diff --git a/modules/programs/nvim/plugins/nvim-lspconfig.lua b/modules/programs/nvim/plugins/nvim-lspconfig.lua index 81a1421..97b4de3 100644 --- a/modules/programs/nvim/plugins/nvim-lspconfig.lua +++ b/modules/programs/nvim/plugins/nvim-lspconfig.lua @@ -28,9 +28,16 @@ local on_attach_def = function(client, bufnr) }, [""] = { l = { + name = "lsp", d = { vim.diagnostic.open_float, "Open diagnostic window" }, c = { vim.lsp.buf.code_action, "Code action" }, - r = { vim.lsp.buf.rename, "Rename" }, + r = { + function() + return ":IncRename " .. vim.fn.expand("") + end, + "Rename", + expr = true, + }, f = { function() vim.lsp.buf.format({ async = true }) From 8768b58ce18e363a2351d39ce0444853b285982e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 12 Aug 2023 16:51:16 +0200 Subject: [PATCH 04/11] feat(nvim): add statuscol-nvim --- modules/programs/nvim/plugins/default.nix | 5 ++++ modules/programs/nvim/plugins/nvim-ufo.lua | 24 ------------------- .../programs/nvim/plugins/statuscol-nvim.lua | 22 +++++++++++++++++ 3 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 modules/programs/nvim/plugins/statuscol-nvim.lua diff --git a/modules/programs/nvim/plugins/default.nix b/modules/programs/nvim/plugins/default.nix index 55ba586..51a6b45 100644 --- a/modules/programs/nvim/plugins/default.nix +++ b/modules/programs/nvim/plugins/default.nix @@ -150,6 +150,11 @@ with builtins; } ]; } + { + plugin = statuscol-nvim; + event = [ "VeryLazy" ]; + conf = readFile ./statuscol-nvim.lua; + } { plugin = vim-fugitive; event = [ "VeryLazy" ]; diff --git a/modules/programs/nvim/plugins/nvim-ufo.lua b/modules/programs/nvim/plugins/nvim-ufo.lua index 3bdedeb..2399582 100644 --- a/modules/programs/nvim/plugins/nvim-ufo.lua +++ b/modules/programs/nvim/plugins/nvim-ufo.lua @@ -2,30 +2,6 @@ vim.o.foldcolumn = "1" -- '0' is not bad vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value vim.o.foldlevelstart = 99 vim.o.foldenable = true -vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] -vim.o.statuscolumn = "%s" -- sign column - .. "%=" - .. "%{%" -- evaluate this, and then evaluate what it returns - .. "&number ?" - .. "(v:relnum ?" - -- when showing relative numbers, make sure to pad so things don't shift as you move the cursor - .. 'printf("%"..len(line("$")).."s", v:relnum)' - .. ":" - .. "v:lnum" - .. ")" - .. ":" - .. '""' - .. "%}" - .. "%#FoldColumn#" -- highlight group for fold - .. "%{" -- expression for showing fold expand/colapse - .. "foldlevel(v:lnum) > foldlevel(v:lnum - 1)" -- any folds? - .. "? (foldclosed(v:lnum) == -1" -- currently open? - .. '? ""' -- point down - .. ': ""' -- point to right - .. ")" - .. ': " "' -- blank for no fold, or inside fold - .. "}" - .. " " local ftMap = { vim = "indent", diff --git a/modules/programs/nvim/plugins/statuscol-nvim.lua b/modules/programs/nvim/plugins/statuscol-nvim.lua new file mode 100644 index 0000000..b1e1eb1 --- /dev/null +++ b/modules/programs/nvim/plugins/statuscol-nvim.lua @@ -0,0 +1,22 @@ +vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] +local builtin = require("statuscol.builtin") +require("statuscol").setup({ + segments = { + { + sign = { name = { ".*" }, auto = true }, + click = "v:lua.ScSa", + }, + { + text = { builtin.lnumfunc }, + click = "v:lua.ScLa", + }, + { + sign = { name = { "GitSigns" }, auto = true }, + click = "v:lua.ScSa", + }, + { + text = { builtin.foldfunc, " " }, + click = "v:lua.ScFa", + }, + }, +}) From d17f034e349a1862db92d25776da17fabae3611d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 16 Aug 2023 16:41:12 +0200 Subject: [PATCH 05/11] refactor(nvim): change up keybindings --- modules/programs/nvim/plugins/default.nix | 2 -- .../programs/nvim/plugins/gitsigns-nvim.lua | 21 +++++++------------ modules/programs/nvim/plugins/oil-nvim.lua | 2 +- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/modules/programs/nvim/plugins/default.nix b/modules/programs/nvim/plugins/default.nix index 51a6b45..4c5ef76 100644 --- a/modules/programs/nvim/plugins/default.nix +++ b/modules/programs/nvim/plugins/default.nix @@ -201,8 +201,6 @@ with builtins; { key = "sk"; cmd = "Telescope keymaps"; desc = "Keymaps"; } { key = "ss"; cmd = "Telescope lsp_document_symbols"; desc = "Symbols (Document)"; } { key = "sS"; cmd = "Telescope lsp_workspace_symbols"; desc = "Symbols (Workspace)"; } - { key = "gc"; cmd = "Telescope git_commits"; desc = "Commits"; } - { key = "gs"; cmd = "Telescope git_status"; desc = "Status"; } ]; dependencies = [ { plugin = plenary-nvim; } diff --git a/modules/programs/nvim/plugins/gitsigns-nvim.lua b/modules/programs/nvim/plugins/gitsigns-nvim.lua index 3cdce95..1a17a9b 100644 --- a/modules/programs/nvim/plugins/gitsigns-nvim.lua +++ b/modules/programs/nvim/plugins/gitsigns-nvim.lua @@ -1,22 +1,15 @@ require("gitsigns").setup() require("which-key").register({ - ["["] = { - h = { "Gitsigns prev_hunk", "Previous hunk" }, - }, - ["]"] = { - h = { "Gitsigns next_hunk", "Next hunk" }, - }, -}) -require("which-key").register({ - h = { - name = "hunk", + ["[h"] = { "Gitsigns prev_hunk", "Previous hunk" }, + ["]h"] = { "Gitsigns next_hunk", "Next hunk" }, + ["g"] = { s = { "Gitsigns stage_hunk", "Stage hunk", mode = { "n", "v" } }, r = { "Gitsigns reset_hunk", "Reset hunk", mode = { "n", "v" } }, S = { "Gitsigns stage_buffer", "Stage buffer" }, R = { "Gitsigns reset_buffer", "Reset buffer" }, u = { "Gitsigns undo_stage_hunk", "Undo stage hunk" }, + p = { "Gitsigns preview_hunk_inline", "Preview hunk (inline)" }, + P = { "Gitsigns preview_hunk", "Preview hunk (float)" }, }, -}, { prefix = "g" }) -require("which-key").register({ - h = { ":Gitsigns select_hunk", "Gitsigns select hunk" }, -}, { prefix = "i", mode = { "o", "x" } }) + ["ih"] = { ":Gitsigns select_hunk", "gitsigns hunk", mode = { "o", "x" } }, +}) diff --git a/modules/programs/nvim/plugins/oil-nvim.lua b/modules/programs/nvim/plugins/oil-nvim.lua index e2afffb..6c9c81e 100644 --- a/modules/programs/nvim/plugins/oil-nvim.lua +++ b/modules/programs/nvim/plugins/oil-nvim.lua @@ -1,4 +1,4 @@ require("oil").setup() require("which-key").register({ - d = { require("oil").toggle_float, "directory (oil)" }, + d = { require("oil").toggle_float, "Directory (oil)" }, }, { prefix = "t" }) From e0599018e229e26c0207be818599051f80f37dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 16 Aug 2023 16:42:26 +0200 Subject: [PATCH 06/11] feat(nvim): add zenmode.nvim --- modules/programs/nvim/plugins/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/programs/nvim/plugins/default.nix b/modules/programs/nvim/plugins/default.nix index 4c5ef76..8fcc9e1 100644 --- a/modules/programs/nvim/plugins/default.nix +++ b/modules/programs/nvim/plugins/default.nix @@ -282,5 +282,14 @@ with builtins; plugin = hmts-nvim; ft = [ "nix" ]; } + { + plugin = zen-mode-nvim; + keys = [ + { key = "tz"; cmd = "ZenMode"; desc = "Zen mode"; } + ]; + dependencies = [ + { plugin = twilight-nvim; } + ]; + } ]; } From 4a5b007e006fd7a0d9b7084d3696881f1abf491f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 16 Aug 2023 16:43:35 +0200 Subject: [PATCH 07/11] fix(nvim): lspconfig for nil --- modules/programs/nvim/plugins/nvim-lspconfig.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/programs/nvim/plugins/nvim-lspconfig.lua b/modules/programs/nvim/plugins/nvim-lspconfig.lua index 97b4de3..0c44ceb 100644 --- a/modules/programs/nvim/plugins/nvim-lspconfig.lua +++ b/modules/programs/nvim/plugins/nvim-lspconfig.lua @@ -13,6 +13,10 @@ capabilities.textDocument.foldingRange = { dynamicRegistration = false, lineFoldingOnly = true, } +-- NOTE https://github.com/neovim/neovim/pull/22405 +capabilities.didChangeWatchedFiles = { + dynamicRegistration = true, +} local lspconfig = require("lspconfig") local on_attach_def = function(client, bufnr) From 44a21426535aaf7966c967e958213edd317d137e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 16 Aug 2023 22:06:48 +0200 Subject: [PATCH 08/11] fix(nvim): eliminate duplicate keybind of --- modules/programs/nvim/plugins/coq-nvim.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/programs/nvim/plugins/coq-nvim.lua b/modules/programs/nvim/plugins/coq-nvim.lua index 9946c3b..63536a8 100644 --- a/modules/programs/nvim/plugins/coq-nvim.lua +++ b/modules/programs/nvim/plugins/coq-nvim.lua @@ -1,3 +1,6 @@ vim.g.coq_settings = { auto_start = "shut-up", + keymap = { + jump_to_mark = "", + }, } From d4eb17856e72fa53429881a7f08aecc8613895fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 17 Aug 2023 16:26:21 +0200 Subject: [PATCH 09/11] build(flake)!: update inputs --- flake.lock | 188 +++++++++++++++----------- modules/profiles/base.nix | 2 +- modules/programs/hyprland/_config.nix | 14 +- modules/programs/hyprland/default.nix | 2 +- 4 files changed, 115 insertions(+), 91 deletions(-) diff --git a/flake.lock b/flake.lock index 93f6319..6a0eb62 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ ] }, "locked": { - "lastModified": 1689334118, - "narHash": "sha256-djk5AZv1yU84xlKFaVHqFWvH73U7kIRstXwUAnDJPsk=", + "lastModified": 1690228878, + "narHash": "sha256-9Xe7JV0krp4RJC9W9W9WutZVlw6BlHTFMiUP/k48LQY=", "owner": "ryantm", "repo": "agenix", - "rev": "0d8c5325fc81daf00532e3e26c6752f7bcde1143", + "rev": "d8c973fd228949736dedf61b7f8cc1ece3236792", "type": "github" }, "original": { @@ -25,11 +25,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1689799111, - "narHash": "sha256-JGucBOBTSYBapMrI7GCMAqTFaT1O7Kqw0S3uBtFawIo=", + "lastModified": 1691983650, + "narHash": "sha256-oA1bIpPc27Kk89n3JGpni7RkcIDRVAsTjUfjRHbKS24=", "owner": "arkenfox", "repo": "user.js", - "rev": "6151d664acced94364e7e3a075e6ac3ca555ef48", + "rev": "915f39959c7e077f00477e6ce34a0f9f9e3e7c6b", "type": "github" }, "original": { @@ -133,11 +133,11 @@ ] }, "locked": { - "lastModified": 1688466019, - "narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=", + "lastModified": 1690933134, + "narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec", + "rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb", "type": "github" }, "original": { @@ -206,7 +206,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1685518550, @@ -224,7 +224,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1685518550, @@ -363,11 +363,11 @@ ] }, "locked": { - "lastModified": 1689875525, - "narHash": "sha256-fgUrFH3bMZ6R7qgBTfuTRGlkZXIkdyjndl6ZbExbjE8=", + "lastModified": 1692131549, + "narHash": "sha256-MFjI8NL63/6HjMZpvJgnB/Pgg2dht22t45jOYtipZig=", "owner": "nix-community", "repo": "home-manager", - "rev": "1443abd2696ec6bd6fb9701e6c26b277a27b4a3e", + "rev": "75cfe974e2ca05a61b66768674032b4c079e55d4", "type": "github" }, "original": { @@ -381,11 +381,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1688849364, - "narHash": "sha256-gW4x5YiCWFlckFiaLZo+RWJa1IyQ2Cx4jTrJzNy1OzQ=", + "lastModified": 1690635289, + "narHash": "sha256-ec77Yf7mqusmGkxrmYXEG4D0DqEcNRA3vFextWVQOVA=", "owner": "hyprwm", "repo": "contrib", - "rev": "3126196e7ed609e7c427a39dc126ea067de62a65", + "rev": "bef073cff65917ba2d888aa4dc39bd9868e2b0a4", "type": "github" }, "original": { @@ -398,15 +398,16 @@ "inputs": { "hyprland-protocols": "hyprland-protocols", "nixpkgs": "nixpkgs_2", + "systems": "systems_2", "wlroots": "wlroots", "xdph": "xdph" }, "locked": { - "lastModified": 1689879667, - "narHash": "sha256-g6XQ1slkxXw1kddaUKBwvYktIPJczSbZVoe4EzjNjD8=", + "lastModified": 1692182360, + "narHash": "sha256-FSJEeAQj0viz52+GE774GiOOtU0X2B2KgXnRCgogSaU=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "f864b15427b363443e767eb5e78f5dc9603c49f3", + "rev": "78fa8adadc146a7efeebf63438c1140662484fba", "type": "github" }, "original": { @@ -420,14 +421,18 @@ "nixpkgs": [ "hyprland", "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" ] }, "locked": { - "lastModified": 1684265364, - "narHash": "sha256-AxNnWbthsuNx73HDQr0eBxrcE3+yfl/WsaXZqUFmkpQ=", + "lastModified": 1691753796, + "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", "owner": "hyprwm", "repo": "hyprland-protocols", - "rev": "8c279b9fb0f2b031427dc5ef4eab53f2ed835530", + "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", "type": "github" }, "original": { @@ -441,11 +446,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1689547456, - "narHash": "sha256-jZQ377LqcazitvH2fVXKiL8kvmpGT3fuqev+yQqvuRw=", + "lastModified": 1691060455, + "narHash": "sha256-V5ulB9CkGh1ghiC4BKvRdoYKZzpaiOKzAOUmJIFkgM0=", "owner": "hyprwm", "repo": "hyprpaper", - "rev": "ac5f7b038d5ac589d32f5ae18f9745bfe5200618", + "rev": "e498c438b1e16dcf32ecb3030b20b83f7ed9ff6d", "type": "github" }, "original": { @@ -472,11 +477,11 @@ }, "master": { "locked": { - "lastModified": 1689880801, - "narHash": "sha256-jWeQSVczGNRNs48DWiAwb6ojKXb+woqoXoVsA1KwdUM=", + "lastModified": 1692198797, + "narHash": "sha256-4MwKoXIBfNI85zZ/tHyLT+M7sF2Zb0XoyhdXtlM6g2c=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ebaae879a74f772ecc827d264e37960087a4b182", + "rev": "c85be71df497312de66b65df8d7ad7b5c0c81d04", "type": "github" }, "original": { @@ -514,11 +519,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1689785735, - "narHash": "sha256-QdjWbe4oNjIazmOrbJ9u5GadaqTV44RiYbiZoLgNKC8=", + "lastModified": 1692141167, + "narHash": "sha256-1My5JBKfHupN9D86eeX8JFr2Wk03qWJObk73NC1/x2s=", "owner": "neovim", "repo": "neovim", - "rev": "86ce3878d662c1dbfec61a5ad8e7c16c4283ed5c", + "rev": "f92bda1dad462de81ec92134dfa9ba637edc7bb7", "type": "github" }, "original": { @@ -537,11 +542,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1689811489, - "narHash": "sha256-rQ1gnq+ApoowEic21nIYIeQ0Qibb3IEEtwv0LgNIYDc=", + "lastModified": 1692144319, + "narHash": "sha256-sJ7KT+dfLEQbsNI2G+ZLKQ0tIS72roMv+xjC+0bTS9k=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "65f2e8da89ba400e7bbad6fe2f51af0ed9f7e968", + "rev": "3632032784ed4a7f761a61a3337f2e1d61210eae", "type": "github" }, "original": { @@ -561,11 +566,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1689759503, - "narHash": "sha256-wFrcae6V58hIlDW+7NDoUXzXBmsU7W/k3V1KIePcwRA=", + "lastModified": 1691372739, + "narHash": "sha256-fZ8KfBMcIFO/R7xaWtB85SFeuUjb9SCH8fxYBnY8068=", "owner": "oxalica", "repo": "nil", - "rev": "59bcad0b13b5d77668c0c125fef71d7b41406d7a", + "rev": "97abe7d3d48721d4e0fcc1876eea83bb4247825b", "type": "github" }, "original": { @@ -665,11 +670,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1688500189, - "narHash": "sha256-djYYiY4lzJOlXOnTHytH6BUugrxHDZjuGxTSrU4gt4M=", + "lastModified": 1691654369, + "narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "78419edadf0fabbe5618643bd850b2f2198ed060", + "rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e", "type": "github" }, "original": { @@ -713,11 +718,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1689752456, - "narHash": "sha256-VOChdECcEI8ixz8QY+YC4JaNEFwQd1V8bA0G4B28Ki0=", + "lastModified": 1692067901, + "narHash": "sha256-kq8Pf/nmlXECDWMkQSRGQkjWsA6G0pjzZkfUEaTmXJE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7f256d7da238cb627ef189d56ed590739f42f13b", + "rev": "ea95c0917609e5c48023cc7c6141bea2fdf13970", "type": "github" }, "original": { @@ -729,11 +734,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1689752456, - "narHash": "sha256-VOChdECcEI8ixz8QY+YC4JaNEFwQd1V8bA0G4B28Ki0=", + "lastModified": 1692128808, + "narHash": "sha256-Di1Zm/P042NuwThMiZNrtmaAjd4Tm2qBOKHX7xUOfMk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7f256d7da238cb627ef189d56ed590739f42f13b", + "rev": "4ed9856be002a730234a1a1ed9dcd9dd10cbdb40", "type": "github" }, "original": { @@ -791,11 +796,11 @@ "nvim-treesitter-textsubjects": { "flake": false, "locked": { - "lastModified": 1676144693, - "narHash": "sha256-4jb9v0xpO17wp85dzojKUQ6hUdNBx3T2tB4fSWoANus=", + "lastModified": 1691029837, + "narHash": "sha256-O57pMYtDR713ItAeUfdkcl2IfBLQcLEa2sb+AXhaqDs=", "owner": "RRethy", "repo": "nvim-treesitter-textsubjects", - "rev": "b913508f503527ff540f7fe2dcf1bf1d1f259887", + "rev": "df75fcec548014f158cda6498ac38c4622c221e1", "type": "github" }, "original": { @@ -813,11 +818,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1689668210, - "narHash": "sha256-XAATwDkaUxH958yXLs1lcEOmU6pSEIkatY3qjqk8X0E=", + "lastModified": 1691747570, + "narHash": "sha256-J3fnIwJtHVQ0tK2JMBv4oAmII+1mCdXdpeCxtIsrL2A=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "eb433bff05b285258be76513add6f6c57b441775", + "rev": "c5ac3aa3324bd8aebe8622a3fc92eeb3975d317a", "type": "github" }, "original": { @@ -829,11 +834,11 @@ "rofi-wayland": { "flake": false, "locked": { - "lastModified": 1679493688, - "narHash": "sha256-8Hu9k84LNi+Gz8zJNE7AxYxmv8XXQz3cG7CFhv31fz4=", + "lastModified": 1690115482, + "narHash": "sha256-fUneGsSWpi8zYrTbF14e/fuf0vaXF8ckOo4OhL1tInM=", "owner": "lbonn", "repo": "rofi", - "rev": "d06095b5ed40e5d28236b7b7b575ca867696d847", + "rev": "ff2338c38fbf6e7049563acf55f9055bcf882a4e", "type": "github" }, "original": { @@ -896,11 +901,11 @@ "smartcolumn-nvim": { "flake": false, "locked": { - "lastModified": 1679417638, - "narHash": "sha256-DjPWBOLbzdfOQAx+6xgV1CD5NKuP1N6An2lmHNHd39Q=", + "lastModified": 1692020684, + "narHash": "sha256-lNEsAkKRpMgdO6Og0odpTn/t4qkzO7EuTjC5ABJhvXc=", "owner": "m4xshen", "repo": "smartcolumn.nvim", - "rev": "0c572e3eae48874f25b74394a486f38cadb5c958", + "rev": "4aa00ad766f3c0f0e2561e0eb42df3ea3743c135", "type": "github" }, "original": { @@ -911,11 +916,11 @@ }, "stable": { "locked": { - "lastModified": 1689680872, - "narHash": "sha256-brNix2+ihJSzCiKwLafbyejrHJZUP0Fy6z5+xMOC27M=", + "lastModified": 1692134936, + "narHash": "sha256-Z68O969cioC6I3k/AFBxsuEwpJwt4l9fzwuAMUhCCs0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "08700de174bc6235043cb4263b643b721d936bdb", + "rev": "bfd953b2c6de4f550f75461bcc5768b6f966be10", "type": "github" }, "original": { @@ -942,16 +947,16 @@ }, "systems_2": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -985,14 +990,29 @@ "type": "github" } }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "telekasten-nvim": { "flake": false, "locked": { - "lastModified": 1689074017, - "narHash": "sha256-yBw0Ja9xBhHcEdzvKvg6LCDzmIgW9kg0XaXS7hcr958=", + "lastModified": 1691743763, + "narHash": "sha256-zYBMUzanFtjnsUrwxjHLvhRODLj1uwGi18wMUWnrqRA=", "owner": "renerocksai", "repo": "telekasten.nvim", - "rev": "4a5e57eee9c5154ed77423bb7fa6619fdb0784cd", + "rev": "584783fdbdd13bb691a435f86ed10a3717fa9e9a", "type": "github" }, "original": { @@ -1008,11 +1028,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1690749969, - "narHash": "sha256-legyKOJljfuNrY74jsgA641E3q6hle4G6qz8YD55CgI=", + "lastModified": 1692198673, + "narHash": "sha256-kLhdmJ4uI248caVxQhYSq+IA+xQHDcp5in4eI8sJphk=", "ref": "refs/heads/main", - "rev": "e3fd65e98be42b367aef019812375e418ef77448", - "revCount": 18, + "rev": "37dc5c727a3d73778d6ee9d63c1468357cf0ed72", + "revCount": 20, "type": "git", "url": "https://gitea.moritzboeh.me/moritz/timers.git" }, @@ -1023,7 +1043,7 @@ }, "utils": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1687171271, @@ -1043,18 +1063,18 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1689611045, - "narHash": "sha256-3RTOlQabkNetQ4O4UzSf57JPco9VGVHhSU1ls5uKBeE=", + "lastModified": 1691073628, + "narHash": "sha256-LlxE3o3UzRY7APYVLGNKM30DBMcDifCRIQiMVSbYLIc=", "owner": "wlroots", "repo": "wlroots", - "rev": "7791ffe0584c4ac13c170e1661ce33bdbd4a9b9e", + "rev": "c74f89d4f84bfed0284d3908aee5d207698c70c5", "type": "gitlab" }, "original": { "host": "gitlab.freedesktop.org", "owner": "wlroots", "repo": "wlroots", - "rev": "7791ffe0584c4ac13c170e1661ce33bdbd4a9b9e", + "rev": "c74f89d4f84bfed0284d3908aee5d207698c70c5", "type": "gitlab" } }, @@ -1067,14 +1087,18 @@ "nixpkgs": [ "hyprland", "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" ] }, "locked": { - "lastModified": 1685385764, - "narHash": "sha256-r+XMyOoRXq+hlfjayb+fyi9kq2JK48TrwuNIAXqlj7U=", + "lastModified": 1691841170, + "narHash": "sha256-RCTm1/MVWYPnReMgyp7tr2ogGYo/pvw38jZaFwemgPU=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "4d9ff0c17716936e0b5ca577a39e263633901ed1", + "rev": "57a3a41ba6b358109e4fc25c6a4706b5f7d93c6b", "type": "github" }, "original": { diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index d6d6523..1717f1f 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -130,7 +130,7 @@ in f ]; - fonts.fonts = with pkgs; [ + fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) diff --git a/modules/programs/hyprland/_config.nix b/modules/programs/hyprland/_config.nix index 67cd433..7ca6520 100644 --- a/modules/programs/hyprland/_config.nix +++ b/modules/programs/hyprland/_config.nix @@ -7,8 +7,6 @@ with lib; let cfg = config.my.programs.hyprland; - boolToYesNo = bool: if bool then "yes" else "no"; - mkRule = rule: windowRegexes: "windowrulev2 = ${rule},${concatStringsSep "," windowRegexes}"; mkRules = rules: windowRegexes: concatStringsSep "\n" (map (flip mkRule windowRegexes) rules); in @@ -58,12 +56,14 @@ in # See https://wiki.hyprland.org/Configuring/Variables/ for more rounding = 3 - blur = ${boolToYesNo cfg.blur} - blur_size = 3 - blur_passes = 3 - blur_new_optimizations = on + blur { + enabled = ${boolToString cfg.blur} + size = 3 + passes = 3 + new_optimizations = on + } - drop_shadow = ${boolToYesNo cfg.shadows} + drop_shadow = ${boolToString cfg.shadows} shadow_range = 10 shadow_render_power = 2 diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index d75333d..c9b387a 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -9,7 +9,7 @@ with lib; let cfg = config.my.programs.hyprland; - hyprland = pkgs.hyprland.override { nvidiaPatches = cfg.nvidiaSupport; }; + hyprland = pkgs.hyprland.override { enableNvidiaPatches = cfg.nvidiaSupport; }; in { options.my.programs.hyprland = { From 95cd9c247ea62453e354c13c474713110ceba20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 17 Aug 2023 17:04:33 +0200 Subject: [PATCH 10/11] feat(kitty): use kitty opacity instead of hyprland --- modules/programs/hyprland/_config.nix | 12 +----------- modules/programs/kitty.nix | 1 + 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/modules/programs/hyprland/_config.nix b/modules/programs/hyprland/_config.nix index 7ca6520..c8b5aab 100644 --- a/modules/programs/hyprland/_config.nix +++ b/modules/programs/hyprland/_config.nix @@ -73,7 +73,7 @@ in animations { enabled = yes - # Some default Lanimations, see https://wiki.hyprland.org/Configuring/Animations/ for more + # see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = sine, 0.445, 0.05, 0.55, 0.95 bezier = quad, 0.455, 0.03, 0.515, 0.955 @@ -120,16 +120,6 @@ in # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more - ${optionalString cfg.blur '' - # Kitty - windowrulev2 = opacity 0.95 0.95, class:^kitty$ - - # Rofi - ${mkRules ["float" "opacity 0.85 0.85" "noborder"] ["class:^([rR]ofi)$"]} - - windowrulev2 = opacity 0.85 0.85, floating:1 - ''} - # Firefox Sharing Indicator ${mkRules ["float" "move 49% 40" "noborder" "nofullscreenrequest"] ["title:^(.*Sharing Indicator)$"]} diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index 1261a65..df34c20 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -21,6 +21,7 @@ in cursor_shape = "underline"; window_padding_width = 3; confirm_os_window_close = 0; + background_opacity = "0.92"; }; keybindings = { "ctrl+plus" = "change_font_size all +2.0"; From ee0568559a440f97fa58f23fe92d13f3d9445c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 21 Aug 2023 10:47:52 +0200 Subject: [PATCH 11/11] fix(nvim): folding character --- modules/programs/nvim/plugins/nvim-ufo.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/nvim/plugins/nvim-ufo.lua b/modules/programs/nvim/plugins/nvim-ufo.lua index 2399582..d940e0e 100644 --- a/modules/programs/nvim/plugins/nvim-ufo.lua +++ b/modules/programs/nvim/plugins/nvim-ufo.lua @@ -32,7 +32,7 @@ end local handler = function(virtText, lnum, endLnum, width, truncate) local newVirtText = {} - local suffix = ("  %d "):format(endLnum - lnum) + local suffix = (" 󰁂 %d "):format(endLnum - lnum) local sufWidth = vim.fn.strdisplaywidth(suffix) local targetWidth = width - sufWidth local curWidth = 0