Compare commits

..

8 Commits

13 changed files with 91 additions and 36 deletions

View File

@@ -0,0 +1,35 @@
local hydra_repl = "hydra-repl"
if not vim.fn.executable(hydra_repl) then
return
end
local function send(lines)
vim.system({ hydra_repl, table.concat(lines, "\n") })
end
local function get_paragraph(buf)
local start_ = vim.fn.search("^$", "bnW")
local end_ = vim.fn.search("^$", "nW") - 1
if end_ < vim.api.nvim_win_get_cursor(0)[1] then
end_ = vim.api.nvim_buf_line_count(buf)
end
return vim.api.nvim_buf_get_lines(buf, start_, end_, false)
end
local function get_selection(buf)
return vim.api.nvim_buf_get_lines(buf, vim.fn.line("'<") - 1, vim.fn.line("'>"), false)
end
vim.api.nvim_create_autocmd("FileType", {
pattern = "javascript",
callback = function(e)
if vim.fn.fnamemodify(vim.api.nvim_buf_get_name(e.buf), ":e") ~= "hydra" then
return
end
local buf = e.buf
vim.keymap.set("n", "<CR>", function() send(get_paragraph(buf)) end, { buffer = buf, desc = "hydra: send block" })
vim.keymap.set("v", "<CR>", function() send(get_selection(buf)) end, { buffer = buf, desc = "hydra: send selection" })
end,
})

View File

@@ -13,11 +13,16 @@ nm <leader>ww <plug>(wiki-index)
" nm <leader>s <plug>(wiki-link-follow-split) " nm <leader>s <plug>(wiki-link-follow-split)
" nm <leader>v <plug>(wiki-link-follow-vsplit) " nm <leader>v <plug>(wiki-link-follow-vsplit)
autocmd BufEnter *.md if expand('%:t') =~ '_' | echo 'hierarchical relation' | endif function! ZKContextualEcho()
autocmd BufEnter *.md if expand('%:t') =~ '--' | echo 'relation' | endif let l:name = expand('%:t')
autocmd BufEnter *.md if expand('%:t') =~ '<>' | echo 'dichotomy' | endif if l:name =~ '_' | echo 'hierarchical relation'
autocmd BufEnter *.md if expand('%:t') =~ 'my-' | echo 'personal file' | endif elseif l:name =~ '--' | echo 'relation'
autocmd BufEnter *.md if expand('%:t') =~ 'project_' | echo 'project file' | endif elseif l:name =~ '<>' | echo 'dichotomy'
elseif l:name =~ 'my-' | echo 'personal file'
elseif l:name =~ 'project_' | echo 'project file'
endif
endfunction
execute 'autocmd BufEnter' g:zk_path . '/*.md' 'call ZKContextualEcho()'
" Only load wiki.vim for zk directory " Only load wiki.vim for zk directory
let g:wiki_index_name='index' let g:wiki_index_name='index'

View File

@@ -42,11 +42,11 @@
}, },
"nixCats": { "nixCats": {
"locked": { "locked": {
"lastModified": 1774835836, "lastModified": 1776724015,
"narHash": "sha256-6ok7iv/9R82vl6MYe3Lwyyb6S5bmW2PxEZtmjzlqyPs=", "narHash": "sha256-kFpzUivYI8F75cZcggmjKM8HEEJPajKNLweYsTYdM7Q=",
"owner": "BirdeeHub", "owner": "BirdeeHub",
"repo": "nixCats-nvim", "repo": "nixCats-nvim",
"rev": "ebb9f279a55ca60ff4e37e4accf6518dc627aa8d", "rev": "da76c45b33d589836946bb566bd91df4cd3cfb09",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -73,11 +73,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1775608838, "lastModified": 1776949667,
"narHash": "sha256-2ySoGH+SAi34U0PeuQgABC0WiH9LQ3tkyHTiE93KUeg=", "narHash": "sha256-GMSVw35Q+294GlrTUKlx087E31z7KurReQ1YHSKp5iw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9a01fad67a57e44e1b3e1d905c6881bcfb209e8a", "rev": "01fbdeef22b76df85ea168fbfe1bfd9e63681b30",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -71,6 +71,7 @@
{ {
lspsAndRuntimeDeps = with pkgs; { lspsAndRuntimeDeps = with pkgs; {
general = [ general = [
nodejs_24
black black
clang clang
clang-tools clang-tools

View File

@@ -9,5 +9,6 @@ vim.filetype.add({
["%.env.*"] = "dotenv", ["%.env.*"] = "dotenv",
["%.pl$"] = "prolog", ["%.pl$"] = "prolog",
[".*.containerfile.*"] = "dockerfile", [".*.containerfile.*"] = "dockerfile",
["%.hydra$"] = "javascript",
}, },
}) })

View File

@@ -13,13 +13,19 @@ local function get_markdown_files(base)
return items return items
end end
function source:get_keyword_pattern()
return "[%w%./%-]*"
end
function source:complete(params, callback) function source:complete(params, callback)
local cursor_before_line = params.context.cursor_before_line local cursor_before_line = params.context.cursor_before_line
local cursor_after_line = params.context.cursor_after_line or "" local cursor_after_line = params.context.cursor_after_line or ""
local trigger = cursor_before_line:match("%[[^%]]*%]%(([^)]*)$") if not cursor_before_line:match("%[[^%]]*%]%(") then
callback({})
return
end
if trigger ~= nil then
local items = get_markdown_files(".") local items = get_markdown_files(".")
local next_char = cursor_after_line:sub(1, 1) local next_char = cursor_after_line:sub(1, 1)
@@ -32,9 +38,6 @@ function source:complete(params, callback)
end end
callback(items) callback(items)
else
callback({})
end
end end
function source:get_trigger_characters() function source:get_trigger_characters()

View File

@@ -47,7 +47,10 @@
printing.enable = true; printing.enable = true;
modeling.enable = true; modeling.enable = true;
}; };
ai-tools.opencode.enable = true; ai-tools = {
claude-code.enable = true;
opencode.enable = true;
};
browser.primary = "librewolf"; browser.primary = "librewolf";
cloud.hetzner.enable = true; cloud.hetzner.enable = true;
comms.signal.enable = true; comms.signal.enable = true;

View File

@@ -43,7 +43,10 @@
}; };
modules."3d".printing.enable = true; modules."3d".printing.enable = true;
ai-tools.opencode.enable = true; ai-tools = {
claude-code.enable = true;
opencode.enable = true;
};
browser.primary = "librewolf"; browser.primary = "librewolf";
cloud.hetzner.enable = true; cloud.hetzner.enable = true;
comms.signal.enable = true; comms.signal.enable = true;

View File

@@ -68,7 +68,7 @@ in
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" ];
}; };
}) })
mcp-nixos # mcp-nixos
]; ];
}) })
(lib.mkIf cfg.tirith.enable { (lib.mkIf cfg.tirith.enable {

View File

@@ -6,6 +6,7 @@ let
in in
{ {
config = { config = {
nixpkgs.allowedUnfree = [ "claude-code" ];
secrets.groups.opencode = [ "api-key" ]; secrets.groups.opencode = [ "api-key" ];
sops.templates."opencode/auth.json" = { sops.templates."opencode/auth.json" = {

View File

@@ -0,0 +1,7 @@
{
services.logind.settings.Login = {
HandleLidSwitch = "suspend";
IdleAction = "suspend";
IdleActionSec = 1800;
};
}

View File

@@ -9,6 +9,8 @@ let
cfg = config.desktop; cfg = config.desktop;
in in
{ {
imports = [ ../logind.nix ];
options.desktop = { options.desktop = {
ly = { ly = {
enable = lib.mkOption { enable = lib.mkOption {
@@ -38,12 +40,6 @@ in
services = { services = {
gnome.gnome-keyring.enable = false; gnome.gnome-keyring.enable = false;
dbus.enable = true; dbus.enable = true;
logind.settings.Login = {
HandleLidSwitch = "suspend";
IdleAction = "suspend";
IdleActionSec = 1800;
};
displayManager.ly = lib.mkIf cfg.ly.enable { displayManager.ly = lib.mkIf cfg.ly.enable {
enable = true; enable = true;
}; };