feat: cubyz

This commit is contained in:
2025-11-12 20:38:35 +01:00
parent ae93255200
commit 51196aaefa
5 changed files with 179 additions and 10 deletions

View File

@@ -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 { };

View File

@@ -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 = "<c-s>";
mode = [
"c"
];
action.__raw = "function() require('flash').toggle() end";
options.desc = "Toggle Flash Search";
}
];
vim.keymap.set({'n', 'x', 'o'}, 's', '<Plug>(leap)')
vim.keymap.set('n', 'S', '<Plug>(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
-- (<enter>/<backspace>) 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;

View File

@@ -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}}

View File

@@ -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

View File

@@ -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 ];
};
}