From 38c14ead497041e21f4354f27a611e8c2383a5aa Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Tue, 10 May 2022 15:28:36 +0300 Subject: [PATCH] feat: update-nix-fetchgit stuff --- configuration.nix | 2 ++ dotfiles/fish/config.fish | 4 ++++ dotfiles/kmonad/keymap.kbd | 4 ++-- .../lspconfig/server_configurations/agda.lua | 12 ------------ dotfiles/neovim/lua/my/helpers.lua | 18 +++++++++--------- .../lua/my/helpers/update-nix-fetchgit.lua | 9 +++++++++ dotfiles/neovim/lua/my/keymaps.lua | 3 +++ dotfiles/neovim/lua/my/plugins/comment.lua | 2 +- dotfiles/neovim/lua/my/plugins/lspconfig.lua | 10 +++++++++- dotfiles/neovim/syntax/bkf.vim | 12 +++++++++--- modules/applications/misc.nix | 1 + modules/applications/neovim.nix | 1 + modules/nix.nix | 4 ++-- modules/overlays/flakes.nix | 7 +++++++ modules/overlays/myPackages.nix | 2 +- modules/themes/themes.nix | 2 ++ 16 files changed, 62 insertions(+), 31 deletions(-) delete mode 100644 dotfiles/neovim/lua/lspconfig/server_configurations/agda.lua create mode 100644 dotfiles/neovim/lua/my/helpers/update-nix-fetchgit.lua diff --git a/configuration.nix b/configuration.nix index b1beb89..2a3e608 100644 --- a/configuration.nix +++ b/configuration.nix @@ -40,6 +40,8 @@ chainloader /EFI/Microsoft/Boot/bootmgfw.efi } ''; + theme = pkgs.nixos-grub2-theme; + version = 2; }; }; diff --git a/dotfiles/fish/config.fish b/dotfiles/fish/config.fish index 464f2dd..267995f 100644 --- a/dotfiles/fish/config.fish +++ b/dotfiles/fish/config.fish @@ -14,3 +14,7 @@ function fish_user_key_bindings bind -M insert -m default jk 'commandline -f repaint' bind -M insert -m default kj 'commandline -f repaint' end + +# direnv hook, aparently +# https://direnv.net/docs/hook.html +direnv hook fish | source diff --git a/dotfiles/kmonad/keymap.kbd b/dotfiles/kmonad/keymap.kbd index 52bb907..20e383e 100644 --- a/dotfiles/kmonad/keymap.kbd +++ b/dotfiles/kmonad/keymap.kbd @@ -1,8 +1,8 @@ (defcfg ;; For Linux ;; input (device-file "$DEVICE") ;; gets dynamically replaced by nix - input (device-file "/dev/input/by-path/pci-0000:00:14.0-usb-0:5:1.0-event-kbd") - ;; input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd") + ;; input (device-file "/dev/input/by-path/pci-0000:00:14.0-usb-0:1:1.0-event-kbd") + input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd") output (uinput-sink "My KMonad output" ;; To understand the importance of the following line, see the section on ;; Compose-key sequences at the near-bottom of this file. diff --git a/dotfiles/neovim/lua/lspconfig/server_configurations/agda.lua b/dotfiles/neovim/lua/lspconfig/server_configurations/agda.lua deleted file mode 100644 index ba6194d..0000000 --- a/dotfiles/neovim/lua/lspconfig/server_configurations/agda.lua +++ /dev/null @@ -1,12 +0,0 @@ -local bin_name = 'agda-language-server' -local cmd = {bin_name, '--stdio'} - -if vim.fn.has 'win32' == 1 then cmd = {'cmd.exe', '/C', bin_name, '--stdio'} end - -return { - default_config = { - cmd = cmd, - filetypes = {'agda'} - -- root_dir = util.root_pattern('bower.json', 'psc-package.json', 'spago.dhall'), - } -} diff --git a/dotfiles/neovim/lua/my/helpers.lua b/dotfiles/neovim/lua/my/helpers.lua index fbaeb78..f4fb221 100644 --- a/dotfiles/neovim/lua/my/helpers.lua +++ b/dotfiles/neovim/lua/my/helpers.lua @@ -1,21 +1,21 @@ local M = {} -function M.global(name, value) - vim.g[name] = value -end +function M.global(name, value) vim.g[name] = value end function M.mergeTables(t1, t2) local t3 = {} - if t1 ~= nil then - for k, v in pairs(t1) do t3[k] = v end - end + if t1 ~= nil then for k, v in pairs(t1) do t3[k] = v end end - if t2 ~= nil then - for k, v in pairs(t2) do t3[k] = v end - end + if t2 ~= nil then for k, v in pairs(t2) do t3[k] = v end end return t3 end +function M.saveCursor(callback) + local cursor = vim.api.nvim_win_get_cursor() + callback() + vim.api.nvim_win_set_cursor(cursor) +end + return M diff --git a/dotfiles/neovim/lua/my/helpers/update-nix-fetchgit.lua b/dotfiles/neovim/lua/my/helpers/update-nix-fetchgit.lua new file mode 100644 index 0000000..f49b62a --- /dev/null +++ b/dotfiles/neovim/lua/my/helpers/update-nix-fetchgit.lua @@ -0,0 +1,9 @@ +local M = {} + +function M.update() + require("my.helpers").saveCursor(function() + vim.cmd(":%!update-nix-fetchgit") + end) +end + +return M diff --git a/dotfiles/neovim/lua/my/keymaps.lua b/dotfiles/neovim/lua/my/keymaps.lua index b866c5c..d63f3bd 100644 --- a/dotfiles/neovim/lua/my/keymaps.lua +++ b/dotfiles/neovim/lua/my/keymaps.lua @@ -1,5 +1,6 @@ local helpers = require("my.helpers") local arpeggio = require("my.plugins.arpeggio") +local au = require("my.helpers.augroup") local M = {} @@ -31,6 +32,8 @@ function M.setup() arpeggio.chord("i", "k", "") -- Rebind digraph insertion to leader+k arpeggio.chord("inv", "a", "") -- Rebind switching to the last pane using leader+a end + + return M end return M diff --git a/dotfiles/neovim/lua/my/plugins/comment.lua b/dotfiles/neovim/lua/my/plugins/comment.lua index e1c14ae..354eb7c 100644 --- a/dotfiles/neovim/lua/my/plugins/comment.lua +++ b/dotfiles/neovim/lua/my/plugins/comment.lua @@ -1,7 +1,7 @@ local A = require("my.helpers.augroup") local M = {} -local extraCommentStrings = {nix = "# %s", lean = "/- %s -/"} +local extraCommentStrings = {nix = "# %s", lean = "/- %s -/", bkf = "-- %s"} -- Update comments for certain languages local function setCommentString(extension, commentString) diff --git a/dotfiles/neovim/lua/my/plugins/lspconfig.lua b/dotfiles/neovim/lua/my/plugins/lspconfig.lua index 7e631ac..444986c 100644 --- a/dotfiles/neovim/lua/my/plugins/lspconfig.lua +++ b/dotfiles/neovim/lua/my/plugins/lspconfig.lua @@ -1,3 +1,5 @@ +local A = require("my.plugins.arpeggio") + local M = {} local function map(buf, mode, lhs, rhs, opts) @@ -53,6 +55,12 @@ local function on_attach_typescript(client, bufnr) M.on_attach(client, bufnr) end +local function on_attach_lua() + A.chordSilent("n", "ug", + ":lua require('my.helpers.update-nix-fetchgit').update()", + {settings = "b"}) +end + -- General server config local servers = { tsserver = {on_attach = on_attach_typescript}, @@ -89,7 +97,7 @@ local servers = { } } }, - rnix = {}, + rnix = {on_attach = on_attach_lua}, hls = { haskell = { -- set formatter diff --git a/dotfiles/neovim/syntax/bkf.vim b/dotfiles/neovim/syntax/bkf.vim index eb4b6ce..13dbff3 100644 --- a/dotfiles/neovim/syntax/bkf.vim +++ b/dotfiles/neovim/syntax/bkf.vim @@ -4,23 +4,29 @@ endif echom "Our syntax highlighting code will go here." -syntax keyword kfKeyword alias template layer using -" syntax keyword kfFunction tap-macro +syntax keyword kfKeyword alias template layer using path name input output assume fun as import exporting module unsafe def +syntax keyword kfFunction LayerTemplate Sequence Chord Keycode Layer Broken + syntax match kfComment "\v--.*$" syntax match kfOperator "\v_" +syntax match kfOperator "\v\," +syntax match kfOperator "\v\." syntax match kfOperator "\v\:" syntax match kfOperator "\v\|" syntax match kfOperator "\v\=" syntax match kfOperator "\v\=\>" +syntax match kfOperator "\v\-\>" +syntax match kfOperator "\v→" syntax match kfOperator "\v\*" syntax match kfOperator "\v\(" syntax match kfOperator "\v\)" +syntax match kfOperator "\vλ" syntax region kfString start=/\v"/ skip=/\v\\./ end=/\v"/ highlight link kfKeyword Keyword -" highlight link kfFunction Function +highlight link kfFunction Function highlight link kfComment Comment highlight link kfOperator Operator highlight link kfString String diff --git a/modules/applications/misc.nix b/modules/applications/misc.nix index 7eb659e..5a9a7b6 100644 --- a/modules/applications/misc.nix +++ b/modules/applications/misc.nix @@ -30,6 +30,7 @@ cmake # kdeconnect sloc # line of code counter + update-nix-fetchgit # editors # vscodium diff --git a/modules/applications/neovim.nix b/modules/applications/neovim.nix index eb3d23c..9476390 100644 --- a/modules/applications/neovim.nix +++ b/modules/applications/neovim.nix @@ -52,6 +52,7 @@ in fd # file finder ripgrep # grep rewrite (I think?) nodePackages.typescript # typescript language + update-nix-fetchgit # useful for nix stuff texlive.combined.scheme-full # latex stuff python38Packages.pygments # required for latex syntax highlighting diff --git a/modules/nix.nix b/modules/nix.nix index c8d61e4..49cf46e 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -22,13 +22,13 @@ "https://nix-community.cachix.org" "https://cm-idris2-pkgs.cachix.org" "https://cache.nixos.org" - "https://all-hies.cachix.org" # Do I even use all-hies anymore? + # "https://all-hies.cachix.org" # Do I even use all-hies anymore? ]; binaryCachePublicKeys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "cm-idris2-pkgs.cachix.org-1:YB2oJSEsD5oMJjAESxolC2GQtE6B5I6jkWhte2gtXjk=" - "all-hies.cachix.org-1:JjrzAOEUsD9ZMt8fdFbzo3jNAyEWlPAwdVuHw4RD43k=" + # "all-hies.cachix.org-1:JjrzAOEUsD9ZMt8fdFbzo3jNAyEWlPAwdVuHw4RD43k=" ]; }; } diff --git a/modules/overlays/flakes.nix b/modules/overlays/flakes.nix index d45272a..a4df394 100644 --- a/modules/overlays/flakes.nix +++ b/modules/overlays/flakes.nix @@ -85,5 +85,12 @@ in kmonad-vim = plugin "kmonad-vim" vim-plugin-kmonad; }; + # a = fetchFromGitHub { + # repo = "kmonad-vim"; + # owner = "kmonad"; + # rev = ""; + # sha256 = ""; + # }; + sddm-theme-chili = sddm-theme-chili; } diff --git a/modules/overlays/myPackages.nix b/modules/overlays/myPackages.nix index c5fc305..6372768 100644 --- a/modules/overlays/myPackages.nix +++ b/modules/overlays/myPackages.nix @@ -2,7 +2,7 @@ self: super: let allThemes = self.callPackage (import ../themes/themes.nix) { }; - currentTheme = "github-dark"; + currentTheme = "github-light"; in with self; { myHelpers = self.callPackage (import ../helpers.nix) { }; diff --git a/modules/themes/themes.nix b/modules/themes/themes.nix index 2ce3fd4..44f998f 100644 --- a/modules/themes/themes.nix +++ b/modules/themes/themes.nix @@ -6,10 +6,12 @@ lib.lists.map (theme: pkgs.callPackage theme { }) [ variant = "light"; # wallpaper = ./wallpapers/wall.png; wallpaper = ./wallpapers/synthwave.jpg; + # wallpaper = ./wallpapers/eye.png; transparency = 0.8; }) (githubVariant { variant = "dark"; + # wallpaper = ./wallpapers/synthwave.jpg; wallpaper = ./wallpapers/spaceship.jpg; transparency = 0.8; })