Compare commits

..

10 commits

Author SHA1 Message Date
3caac1a07e
ci: format
Some checks are pending
quality / changes (push) Waiting to run
quality / Nix Format Check (push) Blocked by required conditions
quality / Deadnix Check (push) Blocked by required conditions
quality / Statix Check (push) Blocked by required conditions
quality / Lua Format Check (push) Blocked by required conditions
quality / Lua Lint Check (push) Blocked by required conditions
quality / Prettier Format Check (push) Blocked by required conditions
2026-03-13 08:16:29 -04:00
2bcc83c7d9
feat: netcup host config 2026-03-13 08:16:08 -04:00
66c1be4b45
fix(sioyek): pass abspath in synctex script 2026-03-12 15:52:01 -04:00
f1cc5ca1ba
feat: improve inverse search cmd 2026-03-12 15:42:20 -04:00
aea9d07ae9
feat: voice to text 2026-03-11 20:04:18 -04:00
3b589f54ce
feat: tts 2026-03-11 18:52:53 -04:00
8011242194
feat: voice to text 2026-03-11 18:50:11 -04:00
6fae26733d
feat: whisper 2026-03-11 17:40:21 -04:00
be92190ff5
ci: format 2026-03-11 15:03:05 -04:00
5106c4afb5
feat(tea): use tea 2026-03-10 18:28:56 -04:00
22 changed files with 424 additions and 116 deletions

View file

@ -135,6 +135,7 @@ bind = , I, exec, hyprctl dispatch submap reset; ctl idle
bind = , K, exec, hyprctl dispatch submap reset; ctl keyboard next bind = , K, exec, hyprctl dispatch submap reset; ctl keyboard next
bind = , M, exec, hyprctl dispatch submap reset; ctl media bind = , M, exec, hyprctl dispatch submap reset; ctl media
bind = , P, exec, hyprctl dispatch submap reset; ctl power bind = , P, exec, hyprctl dispatch submap reset; ctl power
bind = , D, exec, hyprctl dispatch submap reset; ctl dictate
bind = , T, exec, hyprctl dispatch submap reset; theme bind = , T, exec, hyprctl dispatch submap reset; theme
bind = , catchall, submap, reset bind = , catchall, submap, reset

View file

@ -1,18 +1,14 @@
-- Rerun tests only if their modification time changed.
cache = true cache = true
ignore = { ignore = {
"122", -- Setting a read-only field of a global variable. "122",
"212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off. "212",
"631", -- max_line_length, vscode pkg URL is too long "631",
} }
-- Global objects defined by the C code
read_globals = { read_globals = {
"vim", "vim",
} }
include_files = { "lua", "tests" } include_files = { "lua", "tests" }
exclude_files = { ".luacheckrc", "tests/**/*_spec.lua" } exclude_files = { ".luacheckrc", "tests/**/*_spec.lua" }
-- vim: ft=lua tw=80

View file

@ -1,10 +1,4 @@
{ {
"lazy.nvim": { "guard-collection": { "branch": "main", "commit": "edf6c86c06badc972964dadb7fd469022690cbf0" },
"branch": "main", "guard.nvim": { "branch": "main", "commit": "addb8d2f40662b8b62d60dd7d18f503beb2332e7" }
"commit": "85c7ff3711b730b4030d03144f6db6375044ae82"
},
"midnight.nvim": {
"branch": "main",
"commit": "fe062a6f2e5bd77cd8a260f61e6e12789eaf4f13"
}
} }

View file

@ -2,65 +2,67 @@ local M = {}
local Methods = vim.lsp.protocol.Methods local Methods = vim.lsp.protocol.Methods
local function fzf_or(fzf_cmd, fallback)
return function()
pcall(require('lz.n').trigger_load, 'ibhagwan/fzf-lua')
if pcall(require, 'fzf-lua') then
vim.cmd('FzfLua ' .. fzf_cmd)
else
fallback()
end
end
end
function M.on_attach(client, bufnr) function M.on_attach(client, bufnr)
if client:supports_method(Methods.textDocument_hover) then if client:supports_method(Methods.textDocument_hover) then
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = bufnr }) vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = bufnr })
end end
local ok, _ = pcall(require, 'fzf-lua')
local mappings = { local mappings = {
{ {
Methods.textDocument_codeAction, Methods.textDocument_codeAction,
'gra', 'gra',
ok and '<cmd>FzfLua lsp_code_actions<CR>' fzf_or('lsp_code_actions', vim.lsp.buf.code_action),
or vim.lsp.buf.code_action,
}, },
{ {
Methods.textDocument_declaration, Methods.textDocument_declaration,
'gD', 'gD',
ok and '<cmd>FzfLua lsp_declarations<CR>' fzf_or('lsp_declarations', vim.lsp.buf.declaration),
or vim.lsp.buf.declaration,
}, },
{ {
Methods.textDocument_definition, Methods.textDocument_definition,
'gd', 'gd',
ok and '<cmd>FzfLua lsp_definitions<CR>' or vim.lsp.buf.definition, fzf_or('lsp_definitions', vim.lsp.buf.definition),
}, },
{ {
Methods.textDocument_implementation, Methods.textDocument_implementation,
'gri', 'gri',
ok and '<cmd>FzfLua lsp_implementations<CR>' fzf_or('lsp_implementations', vim.lsp.buf.implementation),
or vim.lsp.buf.implementation,
}, },
{ {
Methods.textDocument_references, Methods.textDocument_references,
'grr', 'grr',
ok and '<cmd>FzfLua lsp_references<CR>' or vim.lsp.buf.references, fzf_or('lsp_references', vim.lsp.buf.references),
}, },
{ {
Methods.textDocument_typeDefinition, Methods.textDocument_typeDefinition,
'grt', 'grt',
ok and '<cmd>FzfLua lsp_typedefs<CR>' fzf_or('lsp_typedefs', vim.lsp.buf.type_definition),
or vim.lsp.buf.type_definition,
}, },
{ {
Methods.textDocument_documentSymbol, Methods.textDocument_documentSymbol,
'gs', 'gs',
ok and '<cmd>FzfLua lsp_document_symbols<CR>' fzf_or('lsp_document_symbols', vim.lsp.buf.document_symbol),
or vim.lsp.buf.document_symbol,
}, },
{ {
Methods.workspace_diagnostic, Methods.workspace_diagnostic,
'gw', 'gw',
ok and '<cmd>FzfLua lsp_workspace_diagnostics<CR>' fzf_or('lsp_workspace_diagnostics', vim.diagnostic.setqflist),
or vim.diagnostic.setqflist,
}, },
{ {
Methods.workspace_symbol, Methods.workspace_symbol,
'gS', 'gS',
ok and '<cmd>FzfLua lsp_workspace_symbols<CR>' fzf_or('lsp_workspace_symbols', vim.lsp.buf.workspace_symbol),
or vim.lsp.buf.workspace_symbol,
}, },
} }

View file

@ -2,7 +2,7 @@ return {
filetypes = { 'typst' }, filetypes = { 'typst' },
settings = { settings = {
formatterMode = 'typstyle', formatterMode = 'typstyle',
exportPdf = 'onSave', -- exportPdf = 'onSave',
semanticTokens = 'disable', semanticTokens = 'disable',
lint = { lint = {
enabled = true, enabled = true,

View file

@ -60,6 +60,30 @@ local git_status = new_git_status()
local synctex_pdf = {} local synctex_pdf = {}
return { return {
{
'barrettruth/diffs.nvim',
enabled = true,
before = function()
vim.g.diffs = {
debug = false,
integrations = { fugitive = true },
extra_filetypes = { 'diff' },
hide_prefix = true,
highlights = {
gutter = true,
vim = {
enabled = true,
-- max_lines = 500,
},
-- treesitter = { max_lines = 10 },
intra = {
enabled = true,
max_lines = 500,
},
},
}
end,
},
{ {
'barrettruth/midnight.nvim', 'barrettruth/midnight.nvim',
enabled = true, enabled = true,
@ -81,14 +105,14 @@ return {
'barrettruth/canola.nvim', 'barrettruth/canola.nvim',
enabled = true, enabled = true,
after = function() after = function()
require('canola').setup({ require('oil').setup({
skip_confirm_for_simple_edits = true, skip_confirm_for_simple_edits = true,
cleanup_buffers_on_delete = true, cleanup_buffers_on_delete = true,
prompt_save_on_select_new_entry = false, prompt_save_on_select_new_entry = false,
float = { border = 'single' }, float = { border = 'single' },
view_options = { view_options = {
is_hidden_file = function(name, bufnr) is_hidden_file = function(name, bufnr)
local dir = require('canola').get_current_dir(bufnr) local dir = require('oil').get_current_dir(bufnr)
local is_dotfile = vim.startswith(name, '.') local is_dotfile = vim.startswith(name, '.')
and name ~= '..' and name ~= '..'
if not dir then if not dir then
@ -121,7 +145,7 @@ return {
end, end,
}, },
}) })
local refresh = require('canola.actions').refresh local refresh = require('oil.actions').refresh
local orig_refresh = refresh.callback local orig_refresh = refresh.callback
refresh.callback = function(...) refresh.callback = function(...)
git_status = new_git_status() git_status = new_git_status()
@ -137,23 +161,37 @@ return {
end end
end end
end, end,
group = vim.api.nvim_create_augroup( group = vim.api.nvim_create_augroup('AOil', { clear = true }),
'ACanola',
{ clear = true }
),
}) })
end, end,
event = 'DeferredUIEnter', event = 'DeferredUIEnter',
keys = { keys = {
{ '-', '<cmd>e .<cr>' }, { '-', '<cmd>e .<cr>' },
{ '_', '<cmd>Canola<cr>' }, { '_', '<cmd>Oil<cr>' },
}, },
}, },
{ {
'barrettruth/pending.nvim', 'barrettruth/pending.nvim',
before = function() before = function()
vim.g.pending = { vim.g.pending = {
view = {
queue = {
sort = {
'lol',
'dne',
'status',
'due',
'priority',
'order',
'id',
},
},
category = { hide_done_categories = true },
},
debug = false, debug = false,
sync = {
s3 = { bucket = 'pending.nvim', region = 'us-east-1' },
},
data_path = ( data_path = (
os.getenv('XDG_STATE_HOME') os.getenv('XDG_STATE_HOME')
or (os.getenv('HOME') .. '/.local/state') or (os.getenv('HOME') .. '/.local/state')
@ -308,7 +346,7 @@ return {
vim.filetype.add({ vim.filetype.add({
extension = { puml = 'plantuml', pu = 'plantuml' }, extension = { puml = 'plantuml', pu = 'plantuml' },
}) })
vim.fn.serverstart('/tmp/nvim-preview.sock')
vim.api.nvim_create_autocmd('User', { vim.api.nvim_create_autocmd('User', {
pattern = 'PreviewCompileSuccess', pattern = 'PreviewCompileSuccess',
callback = function(args) callback = function(args)
@ -340,12 +378,31 @@ return {
}) })
vim.g.preview = { vim.g.preview = {
debug = false, debug = false,
github = true, github = {
output = function(ctx)
return '/tmp/'
.. vim.fn.fnamemodify(ctx.file, ':t:r')
.. '.html'
end,
},
typst = { open = { 'sioyek', '--new-instance' } }, typst = { open = { 'sioyek', '--new-instance' } },
plantuml = true, plantuml = true,
mermaid = true, mermaid = true,
latex = { latex = {
open = { 'sioyek', '--instance-name', 'preview' }, open = { 'sioyek', '--instance-name', 'preview' },
args = function(ctx)
local dir = vim.fn.fnamemodify(ctx.file, ':h')
.. '/build'
vim.fn.mkdir(dir, 'p')
return {
'-pdf',
'-interaction=nonstopmode',
'-synctex=1',
'-output-directory=' .. dir,
'-pdflatex=pdflatex -file-line-error %O %S',
ctx.file,
}
end,
output = function(ctx) output = function(ctx)
return vim.fn.fnamemodify(ctx.file, ':h') return vim.fn.fnamemodify(ctx.file, ':h')
.. '/build/' .. '/build/'

View file

@ -1,5 +1,5 @@
return { return {
'barrettruth/fzf-lua', 'ibhagwan/fzf-lua',
after = function() after = function()
local fzf = require('fzf-lua') local fzf = require('fzf-lua')
local has_nonicons = pcall(require, 'nonicons') local has_nonicons = pcall(require, 'nonicons')
@ -94,6 +94,7 @@ return {
fzf_reload.reload() fzf_reload.reload()
end end
end, end,
cmd = 'FzfLua',
keys = { keys = {
{ {
'<c-t>', '<c-t>',

View file

@ -25,7 +25,7 @@ return {
args = { '--profile', 'black', '-' }, args = { '--profile', 'black', '-' },
stdin = true, stdin = true,
}) })
:append('black') :fmt('black')
:lint('mypy') :lint('mypy')
ft('lua'):fmt('stylua'):lint('selene') ft('lua'):fmt('stylua'):lint('selene')
@ -43,6 +43,8 @@ return {
ft('sh,bash'):lint('shellcheck') ft('sh,bash'):lint('shellcheck')
ft('zsh'):lint('zsh') ft('zsh'):lint('zsh')
ft('html'):fmt('prettierd')
ft('proto'):fmt('buf'):lint('buf') ft('proto'):fmt('buf'):lint('buf')
ft('dockerfile'):lint('hadolint') ft('dockerfile'):lint('hadolint')
ft('tex'):fmt('latexindent') ft('tex'):fmt('latexindent')
@ -50,7 +52,7 @@ return {
ft('cmake'):fmt('cmake-format') ft('cmake'):fmt('cmake-format')
ft('make'):lint('checkmake') ft('make'):lint('checkmake')
ft('cpp'):lint('cpplint') ft('cpp'):lint('cpplint')
ft('markdown'):fmt('cbfmt'):append('prettierd') ft('markdown'):fmt('cbfmt'):fmt('prettierd')
local lint = require('guard.lint') local lint = require('guard.lint')
ft('nix') ft('nix')

View file

@ -218,30 +218,3 @@ end)
vim.keymap.set('n', '<leader>gp', function() vim.keymap.set('n', '<leader>gp', function()
forge_picker('pr', 'all') forge_picker('pr', 'all')
end) end)
return {
{
'barrettruth/diffs.nvim',
enabled = true,
before = function()
vim.g.diffs = {
debug = false,
integrations = { fugitive = true },
extra_filetypes = { 'diff' },
hide_prefix = false,
highlights = {
-- blend_alpha = 0.9,
gutter = true,
vim = {
enabled = true,
max_lnes = 500,
},
intra = {
enabled = true,
max_lines = 500,
},
},
}
end,
},
}

View file

@ -46,8 +46,9 @@ vim.o.number = true
vim.o.relativenumber = true vim.o.relativenumber = true
vim.o.signcolumn = 'no' vim.o.signcolumn = 'no'
vim.o.statuscolumn = '%s%C %=%{v:relnum?v:relnum:v:lnum} ' vim.o.statuscolumn = "%{%v:virtnum?'':'%s%C %=%{v:relnum?v:relnum:v:lnum} '%}"
vim.o.statusline = " %{len(expand('%'))?expand('%:~').' ':''}%h%m%r%=%c:%l/%L %{&ft!=''?&ft:&bt} " vim.o.statusline =
" %{len(expand('%'))?expand('%:~').' ':''}%h%m%r%=%c:%l/%L %{&ft!=''?&ft:&bt} "
vim.opt.path:append('**') vim.opt.path:append('**')

69
flake.lock generated
View file

@ -5,11 +5,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1772841847, "lastModified": 1773106201,
"narHash": "sha256-Qre73BGBcw1YlhBTTT+T/rVoqVtlCgHYYExUreIJoYs=", "narHash": "sha256-p5JuCe5wywjp2oanroCOzH+kzKCFt7rpJDg+lVykSjw=",
"owner": "ryoppippi", "owner": "ryoppippi",
"repo": "claude-code-overlay", "repo": "claude-code-overlay",
"rev": "871c9fa0d37c0d6b3bdbf30341a8d08a75b1793b", "rev": "a6293ea4b12f65545c21357c1df4dcb885f0de6e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -18,6 +18,26 @@
"type": "github" "type": "github"
} }
}, },
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1773025010,
"narHash": "sha256-khlHllTsovXgT2GZ0WxT4+RvuMjNeR5OW0UYeEHPYQo=",
"owner": "nix-community",
"repo": "disko",
"rev": "7b9f7f88ab3b339f8142dc246445abb3c370d3d3",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -46,11 +66,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1772845525, "lastModified": 1773179137,
"narHash": "sha256-Dp5Ir2u4jJDGCgeMRviHvEQDe+U37hMxp6RSNOoMMPc=", "narHash": "sha256-EdW2bwzlfme0vbMOcStnNmKlOAA05Bp6su2O8VLGT0k=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "27b93804fbef1544cb07718d3f0a451f4c4cd6c0", "rev": "3f98e2bbc661ec0aaf558d8a283d6955f05f1d09",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -87,11 +107,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1772928300, "lastModified": 1773187529,
"narHash": "sha256-7WXA2vUlHNvCjjTDLsM0CGzTE52d8M8tXj+c4QOQnsk=", "narHash": "sha256-g+SvIUF9he6xFI5d3752wNAsOcbKBg6a0HpX16ggKY4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "8df2141922896b7923ab78d624951f29531b5e8a", "rev": "2c00dfe845f47f9cdab706372e82613d233e5c85",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -103,11 +123,11 @@
"neovim-src": { "neovim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1772909350, "lastModified": 1773186516,
"narHash": "sha256-SOywFX51TumgEMzjRN8JBo2E59Dr9+13sye7qv20nR8=", "narHash": "sha256-IPthgh8IUiFme222fCPbFzxZHDmvDY9ibNZ4MS3v+PA=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "e8e694d837427bd158d51dd62a25f165d49725c6", "rev": "3a7ade847f10e22af6cecf92046eee238d6b21f6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -118,11 +138,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1771969195, "lastModified": 1772972630,
"narHash": "sha256-qwcDBtrRvJbrrnv1lf/pREQi8t2hWZxVAyeMo7/E9sw=", "narHash": "sha256-mUJxsNOrBMNOUJzN0pfdVJ1r2pxeqm9gI/yIKXzVVbk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "41c6b421bdc301b2624486e11905c9af7b8ec68e", "rev": "3966ce987e1a9a164205ac8259a5fe8a64528f72",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -149,11 +169,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1772736753, "lastModified": 1772956932,
"narHash": "sha256-au/m3+EuBLoSzWUCb64a/MZq6QUtOV8oC0D9tY2scPQ=", "narHash": "sha256-M0yS4AafhKxPPmOHGqIV0iKxgNO8bHDWdl1kOwGBwRY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "917fec990948658ef1ccd07cef2a1ef060786846", "rev": "608d0cadfed240589a7eea422407a547ad626a14",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -165,11 +185,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1772736753, "lastModified": 1773110118,
"narHash": "sha256-au/m3+EuBLoSzWUCb64a/MZq6QUtOV8oC0D9tY2scPQ=", "narHash": "sha256-mPAG8phMbCReKSiKAijjjd3v7uVcJOQ75gSjGJjt/Rk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "917fec990948658ef1ccd07cef2a1ef060786846", "rev": "e607cb5360ff1234862ac9f8839522becb853bb9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -198,6 +218,7 @@
"root": { "root": {
"inputs": { "inputs": {
"claude-code": "claude-code", "claude-code": "claude-code",
"disko": "disko",
"home-manager": "home-manager", "home-manager": "home-manager",
"neovim-nightly": "neovim-nightly", "neovim-nightly": "neovim-nightly",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
@ -211,11 +232,11 @@
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1772945022, "lastModified": 1773225617,
"narHash": "sha256-Fv14NttjL/7xfi6eVwrSEBAyBvDjI00RLiRNqA5apcw=", "narHash": "sha256-IT0n3jJgf4M7U0EuZJ2XJwXBmSJVVK3auqWDGeHGMzY=",
"owner": "0xc000022070", "owner": "0xc000022070",
"repo": "zen-browser-flake", "repo": "zen-browser-flake",
"rev": "3a6a5ca7fb48cc8fd8183386506a06579d1d79dc", "rev": "413a22ab7acf848ed4e20c3f47ea96ccd4788518",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -11,6 +11,10 @@
zen-browser.url = "github:0xc000022070/zen-browser-flake"; zen-browser.url = "github:0xc000022070/zen-browser-flake";
claude-code.url = "github:ryoppippi/claude-code-overlay"; claude-code.url = "github:ryoppippi/claude-code-overlay";
neovim-nightly.url = "github:nix-community/neovim-nightly-overlay"; neovim-nightly.url = "github:nix-community/neovim-nightly-overlay";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = outputs =
@ -21,6 +25,7 @@
zen-browser, zen-browser,
claude-code, claude-code,
neovim-nightly, neovim-nightly,
disko,
... ...
}: }:
let let
@ -129,6 +134,10 @@
"tailscale" "tailscale"
"libfprint-2-tod1-goodix" "libfprint-2-tod1-goodix"
"brgenml1lpr" "brgenml1lpr"
"cuda_cccl"
"cuda_cudart"
"libcublas"
"cuda_nvcc"
] ]
); );
} }
@ -149,10 +158,12 @@
}; };
}; };
homeConfigurations = { nixosConfigurations.netcup = nixpkgs.lib.nixosSystem {
"barrett@mac" = mkHome macConfig; modules = [
"barrett@mac-work" = mkHome macWorkConfig; disko.nixosModules.disko
"barrett@linux-work" = mkHome linuxWorkConfig; ./hosts/netcup/configuration.nix
{ nixpkgs.hostPlatform = "x86_64-linux"; }
];
}; };
}; };
} }

View file

@ -19,6 +19,7 @@
++ lib.optionals hostConfig.isLinux [ ++ lib.optionals hostConfig.isLinux [
./modules/hyprland.nix ./modules/hyprland.nix
./modules/ui.nix ./modules/ui.nix
./modules/dictation.nix
]; ];
config = { config = {

View file

@ -0,0 +1,24 @@
{
lib,
pkgs,
config,
hostConfig,
...
}:
let
whisper = pkgs.whisper-cpp.override { cudaSupport = hostConfig.gpu == "nvidia"; };
modelDir = "${config.home.homeDirectory}/.local/share/whisper-models";
model = "ggml-large-v3-turbo.bin";
modelUrl = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/${model}";
in
{
home.packages = [ whisper ];
home.activation.downloadWhisperModel = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
if [ ! -f "${modelDir}/${model}" ]; then
run mkdir -p "${modelDir}"
run ${pkgs.curl}/bin/curl -L -o "${modelDir}/${model}" "${modelUrl}"
fi
'';
}

View file

@ -161,7 +161,7 @@ in
font_size 18 font_size 18
status_bar_font_size 18 status_bar_font_size 18
inverse_search_command nvim --server /tmp/nvim-preview.sock --remote-expr "execute('b +%2 %1 | normal! zz')" inverse_search_command ${repoDir}/scripts/nvim-inverse-search %1 %2
''; '';
}; };

View file

@ -336,6 +336,7 @@ AWSEOF
xdg.configFile."claude/settings.json" = lib.mkIf claude { xdg.configFile."claude/settings.json" = lib.mkIf claude {
text = builtins.toJSON { text = builtins.toJSON {
permissions.defaultMode = "acceptEdits"; permissions.defaultMode = "acceptEdits";
notifications.hints = "disabled";
network_access = true; network_access = true;
allowed_domains = [ allowed_domains = [
"github.com" "github.com"

View file

@ -159,6 +159,12 @@ in
]; ];
}; };
home.packages = [ pkgs.tea ];
programs.ssh.matchBlocks."codeberg.org" = {
identityFile = "~/.ssh/id_ed25519";
};
programs.gh = { programs.gh = {
enable = true; enable = true;
settings = { settings = {

View file

@ -0,0 +1,126 @@
{ pkgs, ... }:
{
imports = [ ./disk-config.nix ];
boot.loader.grub = {
enable = true;
efiSupport = true;
efiInstallAsRemovable = true;
device = "nodev";
};
networking = {
hostName = "netcup";
useDHCP = false;
interfaces.eth0 = {
ipv4.addresses = [
{
address = "152.53.168.144";
prefixLength = 22;
}
];
ipv6.addresses = [
{
address = "2a0a:4cc0:2000:af7d:c8e4:dff:fe7f:c233";
prefixLength = 64;
}
];
};
defaultGateway = {
address = "152.53.168.1";
interface = "eth0";
};
defaultGateway6 = {
address = "fe80::1";
interface = "eth0";
};
nameservers = [
"1.1.1.1"
"8.8.8.8"
];
firewall.allowedTCPPorts = [
22
80
443
];
};
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "prohibit-password";
PasswordAuthentication = false;
};
};
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILA1pOJawzHtJqIn56AZT4IhPUh9vUEhLPLwndk5s3iM br.barrettruth@gmail.com"
];
security.acme = {
acceptTerms = true;
defaults.email = "br.barrettruth@gmail.com";
};
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."vault.barrettruth.com" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://127.0.0.1:8222";
};
virtualHosts."git.barrettruth.com" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://127.0.0.1:3000";
};
};
services.vaultwarden = {
enable = true;
backupDir = "/var/backup/vaultwarden";
environmentFile = "/var/lib/vaultwarden/vaultwarden.env";
config = {
DOMAIN = "https://vault.barrettruth.com";
SIGNUPS_ALLOWED = false;
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 8222;
};
};
services.forgejo = {
enable = true;
settings = {
server = {
DOMAIN = "git.barrettruth.com";
ROOT_URL = "https://git.barrettruth.com/";
HTTP_PORT = 3000;
};
service.DISABLE_REGISTRATION = true;
};
};
environment.systemPackages = with pkgs; [
vim
git
];
nix.settings = {
auto-optimise-store = true;
experimental-features = [
"nix-command"
"flakes"
];
};
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
system.stateVersion = "24.11";
}

View file

@ -0,0 +1,32 @@
{
disko.devices.disk.main = {
type = "disk";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02";
};
esp = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
}

1
new Normal file
View file

@ -0,0 +1 @@

View file

@ -126,6 +126,7 @@ audio)
--mesg="$header" --mesg-mode=expand \ --mesg="$header" --mesg-mode=expand \
--font="monospace:size=12" --width="$fw") --font="monospace:size=12" --width="$fw")
rc=$? rc=$?
[ "$rc" = 10 ] && continue
[ "$rc" = 11 ] && { [ "$rc" = 11 ] && {
wpctl set-volume "$node" 5%+ --limit 1.0 wpctl set-volume "$node" 5%+ --limit 1.0
continue continue
@ -532,6 +533,50 @@ power)
"$shutdown") systemctl poweroff ;; "$shutdown") systemctl poweroff ;;
esac esac
;; ;;
dictate)
require pw-record whisper-cli wl-copy notify-send
dtmp="${XDG_RUNTIME_DIR:-/tmp}/dictation"
mkdir -p "$dtmp"
dpid="$dtmp/rec_pid"
daudio="$dtmp/recording.wav"
dmodel="${DICTATE_MODEL:-large-v3-turbo}"
dmodel_dir="${XDG_DATA_HOME:-$HOME/.local/share}/whisper-models"
dmodel_file="$dmodel_dir/ggml-$dmodel.bin"
if [ -f "$dpid" ] && kill -0 "$(cat "$dpid")" 2>/dev/null; then
kill "$(cat "$dpid")" 2>/dev/null
rm -f "$dpid"
sleep 0.2
if [ ! -s "$daudio" ]; then
notify-send -a ctl -t 1250 "no audio"
exit 1
fi
notify-send -a ctl -t 1250 "transcribing..."
text=$(whisper-cli \
--model "$dmodel_file" \
--language "${DICTATE_LANG:-en}" \
--no-prints --no-timestamps \
"$daudio" 2>/dev/null | tr '\n' ' ' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | tr -s ' ')
rm -f "$daudio"
if [ -z "$text" ]; then
notify-send -a ctl -t 1250 "no speech detected"
exit 1
fi
printf '%s' "$text" | wl-copy
notify-send -a ctl -t 1250 "$text"
exit 0
fi
if [ ! -f "$dmodel_file" ]; then
notify-send -a ctl -t 1250 "downloading whisper $dmodel model..."
mkdir -p "$dmodel_dir"
curl -L -o "$dmodel_file" \
"https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-$dmodel.bin"
fi
notify-send -a ctl -t 1250 "recording..."
pw-record "$daudio" &
printf '%s' "$!" > "$dpid"
;;
idle) idle)
require notify-send require notify-send
if systemctl --user is-active --quiet hypridle.service; then if systemctl --user is-active --quiet hypridle.service; then
@ -545,7 +590,7 @@ idle)
fi fi
;; ;;
*) *)
echo "Usage: ctl {screenshot|keyboard|audio|wifi|brightness|volume|media|wallpaper|power|idle|clip}" >&2 echo "Usage: ctl {screenshot|keyboard|audio|wifi|brightness|volume|media|wallpaper|power|idle|clip|dictate}" >&2
exit 1 exit 1
;; ;;
esac esac

13
scripts/nvim-inverse-search Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
file="$1"
line="$2"
for sock in /run/user/"$(id -u)"/nvim.*.0; do
[ -S "$sock" ] || continue
result=$(nvim --headless --server "$sock" --remote-expr "bufnr('$file')" 2>/dev/null)
if [ "$result" != "-1" ] && [ -n "$result" ]; then
nvim --headless --server "$sock" --remote-expr "execute('b +$line $file | normal! zz')" >/dev/null 2>&1
exit 0
fi
done