diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index 1baaa92..8193dff 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -5,7 +5,7 @@ jobs: steps: - uses: https://code.forgejo.org/actions/checkout@v4 - run: nix --version - - run: nix flake check --keep-going + - run: nix flake check --keep-going --verbose build: runs-on: nixos strategy: diff --git a/nvim/extraPlugins/default.nix b/nvim/extraPlugins/default.nix new file mode 100644 index 0000000..26f3cd9 --- /dev/null +++ b/nvim/extraPlugins/default.nix @@ -0,0 +1,4 @@ +{pkgs}: { + vim-jjdescription = pkgs.callPackage ./vim-jjdescription.nix {}; + nvim-silicon = pkgs.callPackage ./nvim-silicon.nix {}; +} diff --git a/nvim/extraPlugins/nvim-silicon.nix b/nvim/extraPlugins/nvim-silicon.nix new file mode 100644 index 0000000..58abaa2 --- /dev/null +++ b/nvim/extraPlugins/nvim-silicon.nix @@ -0,0 +1,15 @@ +{ + vimUtils, + fetchFromGitHub, + silicon, +}: +vimUtils.buildVimPlugin { + name = "nvim-silicon"; + dependencies = [silicon]; + src = fetchFromGitHub { + owner = "michaelrommel"; + repo = "nvim-silicon"; + rev = "v1.0.0"; + hash = "sha256-cZOzgzLUNC9qOS2m/rc6YJfpNGdRTSCAdEPQDy+wT6I="; + }; +} diff --git a/nvim/vim-jjdescription.nix b/nvim/extraPlugins/vim-jjdescription.nix similarity index 100% rename from nvim/vim-jjdescription.nix rename to nvim/extraPlugins/vim-jjdescription.nix diff --git a/nvim/mappings.nix b/nvim/mappings.nix index e548847..49933ef 100644 --- a/nvim/mappings.nix +++ b/nvim/mappings.nix @@ -135,7 +135,14 @@ in [ { mode = "n"; key = "w"; - action = mkRaw "require'conform'.format"; + action = mkRaw "require('conform').format"; options.desc = "Format buffer"; } + # Nvim Silicon + { + mode = "v"; + key = "sc"; + action = mkRaw "require('nvim-silicon').clip"; + options.desc = "Snap Code (to clipboard)"; + } ] diff --git a/nvim/nixvim.nix b/nvim/nixvim.nix index faa012c..3098eef 100644 --- a/nvim/nixvim.nix +++ b/nvim/nixvim.nix @@ -55,11 +55,12 @@ in { inherit (import ./augroups.nix) autoGroups autoCmd; extraPlugins = let plugins = pkgs.unstable.vimPlugins; - jjdescription = pkgs.unstable.callPackage ./vim-jjdescription.nix {}; + extraPlugins = import ./extraPlugins {pkgs = pkgs.unstable;}; in [ plugins.nui-nvim plugins.nvim-web-devicons - jjdescription + extraPlugins.vim-jjdescription + extraPlugins.nvim-silicon ]; # Formatting & linters extraPackages = [ @@ -88,6 +89,22 @@ in { end -- END: Lua Pre Config ''; + extraConfigLua = '' + -- Lua Config + require("nvim-silicon").setup { + theme = "gruvbox-dark", + pad_horiz = 16, + pad_vert = 16, + -- Current buffer name + window_title = function() + return vim.fn.fnamemodify( + vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()), + ":t" + ) + end, + } + -- END: Lua Config + ''; }) ]; }