diff --git a/flake.nix b/flake.nix index cd928ff..b197bbd 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,7 @@ overlays = [ niri.overlays.niri (final: prev: { + cubyz-bin = prev.callPackage ./overlays/cubyz-bin { }; matugen = matugen.packages.${prev.system}.default; gccdiag = prev.callPackage ./overlays/gccdiag { }; gbmonctl = prev.callPackage ./overlays/gbmonctl { }; diff --git a/modules/home-manager/programs/nixvim.nix b/modules/home-manager/programs/nixvim.nix index ff5b78c..6b73d18 100644 --- a/modules/home-manager/programs/nixvim.nix +++ b/modules/home-manager/programs/nixvim.nix @@ -21,6 +21,9 @@ hlsearch = false; incsearch = true; + ignorecase = true; + smartcase = true; + updatetime = 50; fillchars.eob = " "; @@ -82,16 +85,117 @@ }; }; + /* + keymaps = [ + { + key = "s"; + mode = [ + "n" + "x" + "o" + ]; + action.__raw = "function() require('flash').jump() end"; + options.desc = "Flash"; + } + { + key = "S"; + mode = [ + "n" + "x" + "o" + ]; + action.__raw = "function() require('flash').treesitter() end"; + options.desc = "Flash Treesitter"; + } + { + key = "r"; + mode = "o"; + action.__raw = "function() require('flash').remote() end"; + options.desc = "Remote Flash"; + } + { + key = "R"; + mode = [ + "o" + "x" + ]; + action.__raw = "function() require('flash').treesitter_search() end"; + options.desc = "Treesitter Search"; + } + { + key = ""; + mode = [ + "c" + ]; + action.__raw = "function() require('flash').toggle() end"; + options.desc = "Toggle Flash Search"; + } + ]; + vim.keymap.set({'n', 'x', 'o'}, 's', '(leap)') + vim.keymap.set('n', 'S', '(leap-from-window)') + */ + keymaps = [ + { + key = "s"; + mode = [ + "n" + "x" + "o" + ]; + action.__raw = '' + function() + require('leap').leap({ + windows = { vim.api.nvim_get_current_win() }, + inclusive = true + }) + end + ''; + options.desc = "Leap"; + } + { + key = "R"; + mode = [ + "x" + "o" + ]; + action.__raw = '' + function () + require('leap.treesitter').select { + -- To increase/decrease the selection in a clever-f-like manner, + -- with the trigger key itself (vRRRRrr...). The default keys + -- (/) also work, so feel free to skip this. + opts = require('leap.user').with_traversal_keys('R', 'r') + } + end + ''; + } + ]; + plugins = { which-key.enable = true; schemastore.enable = true; todo-comments.enable = true; origami.enable = false; nvim-surround.enable = true; - flash = { + fidget.enable = true; + leap = { enable = true; - settings.modes.search.enabled = true; }; + /* + flash = { + enable = true; + settings = { + label = { + exclude = "jJxXqQ"; + rainbow.enabled = true; + }; + search = { + mode = "exact"; + trigger = ";"; + }; + }; + }; + */ treesitter-context = { enable = false; # TODO: looks weird with Neovide settings.line_numbers = false; diff --git a/modules/home-manager/theme/nvim.vim b/modules/home-manager/theme/nvim.vim index 85771f8..bd3892c 100644 --- a/modules/home-manager/theme/nvim.vim +++ b/modules/home-manager/theme/nvim.vim @@ -72,7 +72,12 @@ hi! TabLineFill guibg={{colors.primary.default.hex}} guifg={{colors.on_primary.d hi! SpecialKey guifg={{colors.primary.default.hex}} hi! Directory guifg={{colors.primary.default.hex}} -hi! Search guifg={{colors.on_tertiary.default.hex}} guibg={{colors.tertiary.default.hex}} + +hi! Search guifg={{colors.on_primary.default.hex}} guibg={{colors.primary.default.hex}} +hi! link IncSearch Search +hi! link CurSearch Search +hi! link LeapMatch Search +hi! link LeapLabel Search hi! CmpItemKindCopilot guifg={{colors.cyan.default.hex}} hi! CmpItemKindNpm guifg={{colors.red.default.hex}} diff --git a/modules/nixos/usecases/gaming.nix b/modules/nixos/usecases/gaming.nix index a180d95..2cc841d 100644 --- a/modules/nixos/usecases/gaming.nix +++ b/modules/nixos/usecases/gaming.nix @@ -28,15 +28,18 @@ in environment.systemPackages = with pkgs; [ steam + cubyz-bin oversteer obs-studio - /*(lutris.override { - extraLibraries = - pkgs: with pkgs; [ - libgudev - libvdpau - ]; - })*/ + /* + (lutris.override { + extraLibraries = + pkgs: with pkgs; [ + libgudev + libvdpau + ]; + }) + */ rpcs3 bottles wineWow64Packages.stagingFull diff --git a/overlays/cubyz-bin/default.nix b/overlays/cubyz-bin/default.nix new file mode 100644 index 0000000..fb032f7 --- /dev/null +++ b/overlays/cubyz-bin/default.nix @@ -0,0 +1,56 @@ +{ + lib, + stdenv, + fetchurl, + autoPatchelfHook, + makeWrapper, + libx11, +}: +stdenv.mkDerivation rec { + pname = "cubyz-bin"; + version = "0.0.1"; + + src = fetchurl { + url = "https://github.com/PixelGuys/Cubyz/releases/download/${version}/Linux-x86_64.tar.gz"; + hash = "sha256-Rmh17XpO/CtLDobc8Jb4ojhtM7fUN+ungbVzQlIvE7U="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + makeWrapper + ]; + + dontConfigure = true; + dontBuild = true; + + buildInputs = [ libx11 ]; + + sourceRoot = "."; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mkdir -p $out/opt + cp -R Cubyz $out/opt/Cubyz + makeWrapper $out/opt/Cubyz/Cubyz $out/bin/cubyz --run "cd $out/opt/Cubyz" + runHook postInstall + ''; + + preFixup = + let + libPath = lib.makeLibraryPath [ + libx11 + ]; + in + '' + patchelf \ + --set-rpath "${libPath}" \ + $out/opt/Cubyz/Cubyz + ''; + + meta = with lib; { + description = "Voxel sandbox game with a large render distance, procedurally generated content and some cool graphical effects."; + homepage = "https://github.com/PixelGuys/Cubyz"; + maintainers = with maintainers; [ theaninova ]; + }; +}