Compare commits

..

No commits in common. "main" and "integration" have entirely different histories.

43 changed files with 207 additions and 1753 deletions

View file

@ -2,7 +2,7 @@
var REG_NONE = NewRegistrar('none'); // No registrar. var REG_NONE = NewRegistrar('none'); // No registrar.
var DNS_BIND = NewDnsProvider('bind'); // ISC BIND. var DNS_BIND = NewDnsProvider('bind'); // ISC BIND.
var DNS_HEDNS = NewDnsProvider('hedns'); var DNS_HEDNS = NewDnsProvider('hedns');
D("lakhwara.com", REG_NONE, D("lakhwara.com", REG_NONE,
DnsProvider(DNS_HEDNS), DnsProvider(DNS_HEDNS),
@ -41,19 +41,18 @@ D('sealight.xyz', REG_NONE, DnsProvider(DNS_HEDNS),
A('ci', '69.61.2.203', TTL(300)), A('ci', '69.61.2.203', TTL(300)),
A('write', '69.61.2.203', TTL(300)), A('write', '69.61.2.203', TTL(300)),
A('photos', '69.61.2.203', TTL(300)), A('photos', '69.61.2.203', TTL(300)),
// vultr melbourne: lituus // vultr: lituus
A('@', '67.219.99.225', TTL(300)), A('@', '45.77.48.108', TTL(300)),
A('jitsi', '67.219.99.225', TTL(300)), A('jitsi', '45.77.48.108', TTL(300)),
A('chat', '67.219.99.225', TTL(300)), A('chat', '45.77.48.108', TTL(300)),
A('element', '67.219.99.225', TTL(300)), A('element', '45.77.48.108', TTL(300)),
A('turn', '67.219.99.225', TTL(300)), A('turn', '45.77.48.108', TTL(300)),
//nullhex free email real estate //nullhex free email real estate
CNAME('key1._domainkey', 'key1.nullhex.com.'), CNAME('key1._domainkey', 'key1.nullhex.com.'),
CNAME('autoconfig', 'autoconfig.nullhex.com.'), CNAME('autoconfig', 'autoconfig.nullhex.com.'),
MX('@', 10, 'smtp-in-1.nullhex.com.'), MX('@', 10, 'smtp-in-1.nullhex.com.'),
MX('@', 20, 'smtp-in-2.nullhex.com.'), MX('@', 20, 'smtp-in-2.nullhex.com.'),
TXT('@', 'v=spf1 a mx ~all'), TXT('@', 'v=spf1 a mx ~all'),
TXT('_atproto', 'did=did:plc:exp76a7fe76w25gstz4lww75'),
SRV('_autodiscover._tcp', 0, 1, 443, 'autodiscover.nullhex.com.'), SRV('_autodiscover._tcp', 0, 1, 443, 'autodiscover.nullhex.com.'),
TXT('_dmarc', 'v=DMARC1; p=quarantine;'), TXT('_dmarc', 'v=DMARC1; p=quarantine;'),
SRV('_imaps._tcp', 0, 1, 993, 'imap.nullhex.com.'), SRV('_imaps._tcp', 0, 1, 993, 'imap.nullhex.com.'),

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,6 @@
{ {
description = "Sealight NixOS Config"; description = "Sealight NixOS Config";
nixConfig = {
extra-substituters = [ "https://cache.numtide.com" ];
extra-trusted-public-keys = [ "niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g=" ];
};
inputs = { inputs = {
# Nixpkgs # Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
@ -70,15 +65,6 @@
inputs.nixpkgs.follows = "unstable"; inputs.nixpkgs.follows = "unstable";
}; };
# Tangled (atproto tools)
tangled = {
url = "git+https://tangled.org/@tangled.org/core";
inputs.nixpkgs.follows = "nixpkgs";
};
# LLM Agents
llm-agents.url = "github:numtide/llm-agents.nix";
# Others # Others
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
rust-overlay = { rust-overlay = {
@ -87,10 +73,6 @@
}; };
tidalcycles.url = "github:mitchmindtree/tidalcycles.nix"; tidalcycles.url = "github:mitchmindtree/tidalcycles.nix";
tidalcycles.inputs.nixpkgs.follows = "unstable"; tidalcycles.inputs.nixpkgs.follows = "unstable";
autohide-tdrop = {
url = "github:I-Want-ToBelieve/autohide-tdrop";
inputs.nixpkgs.follows = "nixpkgs";
};
# TODO hundred rabbits software # TODO hundred rabbits software
# TODO needs secrets # TODO needs secrets
# dhyan.url = "git+ssh://gitea@git.sealight.xyz/aynish/dhyan?ref=main"; # dhyan.url = "git+ssh://gitea@git.sealight.xyz/aynish/dhyan?ref=main";
@ -102,8 +84,8 @@
outputs = { self, nixpkgs, unstable, nixos-hardware, home-manager, deploy-rs outputs = { self, nixpkgs, unstable, nixos-hardware, home-manager, deploy-rs
, agenix, disko, basant, grasp, nix-matrix-appservices, nur, tidalcycles , agenix, disko, basant, grasp, nix-matrix-appservices, nur, tidalcycles
, rust-overlay, vimwikicli, autohide-tdrop, darwin, nix-homebrew, homebrew-bundle , rust-overlay, vimwikicli, darwin, nix-homebrew, homebrew-bundle
, homebrew-core, homebrew-cask, jovian, tangled, llm-agents, ... }@inputs: , homebrew-core, homebrew-cask, jovian, ... }@inputs:
let let
forAllSystems = nixpkgs.lib.genAttrs [ forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux" "aarch64-linux"
@ -119,7 +101,6 @@
}; };
vimwikiOverlay = final: prev: { vimwikiOverlay = final: prev: {
vimwiki-cli = vimwikicli.packages.${prev.system}.vimwiki-cli; vimwiki-cli = vimwikicli.packages.${prev.system}.vimwiki-cli;
autohide-tdrop = autohide-tdrop.packages.${prev.system}.default;
}; };
nixpkgsFor = forAllSystems (system: nixpkgsFor = forAllSystems (system:
@ -135,7 +116,6 @@
"vcv-rack" "vcv-rack"
"SunVox" "SunVox"
"renoise" "renoise"
"bitwig-studio-unwrapped"
]; ];
}; };
overlays = [ overlays = [
@ -161,7 +141,6 @@
# ]; # ];
overlays = [ overlays = [
agenix.overlays.default agenix.overlays.default
tangled.overlays.default # atproto tools only on lite deployments
self.overlays.additions self.overlays.additions
self.overlays.modifications self.overlays.modifications
tidalcycles.overlays.default # needed for nvim which comes pre-installed lol tidalcycles.overlays.default # needed for nvim which comes pre-installed lol
@ -213,8 +192,6 @@
"steam" "steam"
"steam-original" "steam-original"
"steam-runtime" "steam-runtime"
"steamdeck-hw-theme"
"steam-jupiter-unwrapped"
]; ];
}; };
overlays = [ overlays = [
@ -268,7 +245,6 @@
nix.registry.unstable.flake = unstable; nix.registry.unstable.flake = unstable;
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.users.anish = import ./home/gui; home-manager.users.anish = import ./home/gui;
} }
]; ];
@ -331,32 +307,30 @@
nix.registry.nixpkgs.flake = nixpkgs; nix.registry.nixpkgs.flake = nixpkgs;
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.users.anish = import ./home/dev; home-manager.users.anish = import ./home/dev;
} }
]; ];
}; };
# new version of unstable has many changes I couldn't be bothered to deal with rn deck = unstable.lib.nixosSystem rec {
#deck = unstable.lib.nixosSystem rec { specialArgs = { inherit inputs self; };
# specialArgs = { inherit inputs self; }; system = "x86_64-linux";
# system = "x86_64-linux"; pkgs = deckPkgsFor.${system};
# pkgs = deckPkgsFor.${system}; modules = [
# modules = [ ./hosts/deck
# ./hosts/deck jovian.nixosModules.default
# jovian.nixosModules.default self.nixosModules.wireguard
# self.nixosModules.wireguard agenix.nixosModules.age
# agenix.nixosModules.age self.nixosModules.backup
# self.nixosModules.backup home-manager.nixosModules.home-manager
# home-manager.nixosModules.home-manager {
# { nix.registry.nixpkgs.flake = unstable;
# nix.registry.nixpkgs.flake = unstable; home-manager.useGlobalPkgs = true;
# home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true;
# home-manager.useUserPackages = true; home-manager.users.anish = import ./home/gui;
# home-manager.users.anish = import ./home/gui; }
# } ];
# ]; };
#};
}; };
# Darwin configuration entrypoint # Darwin configuration entrypoint
@ -375,7 +349,6 @@
users.anishlakhwara = import ./home/darwin; users.anishlakhwara = import ./home/darwin;
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
}; };
} }
]; ];
@ -406,9 +379,8 @@
}; };
}; };
lituus = { lituus = {
hostname = "67.219.99.225"; hostname = "sealight.xyz";
autoRollback = false; autoRollback = false;
remoteBuild = true;
profiles.system = { profiles.system = {
user = "root"; user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos path = deploy-rs.lib.x86_64-linux.activate.nixos

View file

@ -1,4 +1,4 @@
{ self, pkgs, inputs, ... }: { self, pkgs, ... }:
{ {
imports = [ imports = [
../profiles/nvim ../profiles/nvim
@ -8,7 +8,6 @@
../profiles/task ../profiles/task
../profiles/kitty ../profiles/kitty
../profiles/tmux ../profiles/tmux
../profiles/opencode
# ../profiles/firefox # ../profiles/firefox
]; ];

View file

@ -1,5 +1,5 @@
{ self, pkgs, inputs, ... }: { { self, pkgs, ... }: {
imports = imports =
[ ../profiles/cli ../profiles/nvim ../profiles/direnv ../profiles/git ../profiles/opencode ]; [ ../profiles/cli ../profiles/nvim ../profiles/direnv ../profiles/git ];
home.stateVersion = "22.05"; home.stateVersion = "22.05";
} }

View file

@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: { pkgs, ... }:
{ {
imports = [ imports = [
../core ../core
@ -10,16 +10,20 @@
../profiles/sync/kitaab ../profiles/sync/kitaab
../profiles/ssh ../profiles/ssh
../profiles/task ../profiles/task
../profiles/opencode
]; ];
# GPG configuration for user session # GPG configuration for user session
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
pinentryPackage = pkgs.pinentry-curses; pinentry.package = pkgs.pinentry-rofi; # Use rofi for consistency with desktop theme
enableSshSupport = true; enableSshSupport = true;
defaultCacheTtl = 28800; # 8 hours defaultCacheTtl = 28800; # 8 hours
maxCacheTtl = 86400; # 24 hours maxCacheTtl = 86400; # 24 hours
extraConfig = ''
pinentry-program ${pkgs.writeShellScript "pinentry-rofi-themed" ''
exec ${pkgs.pinentry-rofi}/bin/pinentry-rofi -theme ~/.config/rofi/theme/passmenu.rasi "$@"
''}
'';
}; };
programs.gpg = { programs.gpg = {

View file

@ -10,7 +10,6 @@
git-machete git-machete
bottom bottom
gptfdisk gptfdisk
difftastic
starship starship
jq jq
manix manix
@ -31,7 +30,7 @@
bat bat
fd fd
ncdu ncdu
dust du-dust
# dia-cli # dia-cli
duf duf
trash-cli trash-cli
@ -56,8 +55,6 @@
gnupg gnupg
syncthing syncthing
dijo dijo
nixfmt-rfc-style
nix-tree
#ssb-patchwork #ssb-patchwork
fontconfig fontconfig
pandoc pandoc
@ -162,7 +159,6 @@
initContent = '' initContent = ''
bindkey -v bindkey -v
autopair-init autopair-init
export PATH="$PATH:/Users/anishlakhwara/go/bin"
''; '';
sessionVariables = { sessionVariables = {
EDITOR = "nvim"; EDITOR = "nvim";
@ -305,12 +301,11 @@
nepl = "n repl '<nixpkgs>'"; nepl = "n repl '<nixpkgs>'";
srch = "ns nixpkgs"; srch = "ns nixpkgs";
orch = "ns override"; orch = "ns override";
# Impure for bitwig on linux, not sure what it's for in darwin
nrb = '' nrb = ''
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
cd ~/usr/helm && sudo darwin-rebuild switch --impure --flake ".#Anishs-MacBook-Pro" && cd $OLDPWD cd ~/usr/helm && sudo darwin-rebuild switch --impure --flake ".#Anishs-MacBook-Pro" && cd $OLDPWD
else else
cd /tmp && sudo nixos-rebuild switch --impure --flake '/home/anish/usr/helm#curve' && cd $OLDPWD cd /tmp && sudo nixos-rebuild switch --flake '/home/anish/usr/helm#curve' && cd $OLDPWD
fi fi
''; '';
nrt = "cd /tmp; sudo nixos-rebuild test --flake '/home/anish/usr/helm#curve'; cd $OLDPWD"; nrt = "cd /tmp; sudo nixos-rebuild test --flake '/home/anish/usr/helm#curve'; cd $OLDPWD";

View file

@ -9,8 +9,9 @@ mouse_map left click ungrabbed mouse_click_url_or_select
confirm_os_window_close 0 confirm_os_window_close 0
enable_audio_bell no enable_audio_bell no
# Ctrl+V for paste # Ctrl+V for paste
map ctrl+v paste_from_clipboard map ctrl+v paste_from_clipboard
mouse_map middle release ungrabbed paste_from_clipboard
-- Allows zen-mode.nvim to increase font size
-- allow_remote_control socket-only
-- listen_on unix:/tmp/kitty

View file

@ -2,35 +2,12 @@
@import "config.rasi" @import "config.rasi"
textbox {
vertical-align: 0.5;
horizontal-align: 0.5;
}
listview { listview {
columns: 9; columns: 4;
lines: 7;
cycle: true;
dynamic: true;
layout: vertical;
flow: horizontal;
reverse: false;
fixed-height: true;
fixed-columns: true;
}
element {
orientation: vertical;
}
element-text {
vertical-align: 0.5;
horizontal-align: 0.5;
font: "FiraCode Nerd Font 24";
} }
textbox-icon { textbox-icon {
str: "❇️ "; str: "🎑";
} }
prompt { prompt {

View file

@ -16,7 +16,7 @@ super + Return
kitty kitty
ctrl + super + Return ctrl + super + Return
tdrop -n tdrop_kitty --post-create-hook "autohide-tdrop &" -ma -h 60% -w 70% -x 15% -y 32 kitty --class=tdrop_kitty xst -e bash -c "(tmux ls | grep -qEv 'attached|scratch' && tmux at) || tmux"
super + space super + space
rofi -show drun -modi drun,run -show-icons -theme theme/appmenu.rasi rofi -show drun -modi drun,run -show-icons -theme theme/appmenu.rasi
@ -25,7 +25,7 @@ super + Tab
rofi -show window -show-icons -theme theme/windowmenu.rasi rofi -show window -show-icons -theme theme/windowmenu.rasi
super + e super + e
rofimoji --selector-args "-theme theme/emojimenu.rasi" --skin-tone moderate --action copy --hidden-descriptions rofimoji --selector-args "-theme theme/emojimenu.rasi" --skin-tone moderate --action copy
super + a super + a
paste paste

View file

@ -1,4 +1,3 @@
{ pkgs, ... }:
{ {
#xdg.configFile = { #xdg.configFile = {
# "git/config".source = ./config; # "git/config".source = ./config;
@ -8,18 +7,14 @@
programs.lazygit.enable = true; programs.lazygit.enable = true;
home.packages = with pkgs; [
unstable.git-spice
];
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Anish Lakhwara"; userName = "Anish Lakhwara";
userEmail = "anish+git@lakhwara.com"; userEmail = "anish+git@lakhwara.com";
delta.enable = true; delta.enable = true;
signing = { signing = {
signByDefault = if pkgs.stdenv.isLinux then false else true; signByDefault = true;
key = if pkgs.stdenv.isLinux then "B8492C8FB53397B7" else "7FC5DF072EF7B716"; key = "7FC5DF072EF7B716";
}; };
ignores = [ ignores = [

View file

@ -0,0 +1,8 @@
{ pkgs }:
# Remove the conditional entirely for now to test
pkgs.vimUtils.buildVimPlugin {
pname = "amp-nvim";
version = "unstable";
src = /Users/anishlakhwara/usr/amp.nvim;
}

View file

@ -0,0 +1,5 @@
-- amp.nvim configuration
require('amp').setup({
auto_start = true,
log_level = "info"
})

View file

@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }: { lib, pkgs, ... }:
let let
customPlugins = { customPlugins = {
vim-zettel = pkgs.vimUtils.buildVimPlugin { vim-zettel = pkgs.vimUtils.buildVimPlugin {
@ -90,17 +90,6 @@ let
sha256 = "czKjJgCpvRSdtR7rNGlJrluDgPIdx94KUyx33op5gdY="; sha256 = "czKjJgCpvRSdtR7rNGlJrluDgPIdx94KUyx33op5gdY=";
}; };
}; };
opencode-nvim = pkgs.vimUtils.buildVimPlugin {
pname = "opencode.nvim";
version = "2024-12-24";
src = pkgs.fetchFromGitHub {
owner = "NickvanDyke";
repo = "opencode.nvim";
rev = "dfca5bb214d78a600781d50da350238b3e6e2621";
hash = "sha256-W7fPGiLpKRe1Nw0MckigUijTNq+L9Z+vxOKcf3oNZf0=";
};
doCheck = false;
};
gh-addressed = pkgs.vimUtils.buildVimPlugin { gh-addressed = pkgs.vimUtils.buildVimPlugin {
pname = "gh-addressed"; pname = "gh-addressed";
version = "2024-09-17"; version = "2024-09-17";
@ -114,6 +103,7 @@ let
doInstallCheck = false; doInstallCheck = false;
nvimRequireCheck = "none"; nvimRequireCheck = "none";
}; };
amp-nvim = import ./amp-plugin.nix { inherit pkgs; };
}; };
my-python-packages = python-packages: with python-packages; [ my-python-packages = python-packages: with python-packages; [
@ -145,9 +135,6 @@ in
syntax match VimwikiPlaceholder /^\s*%link\ze\%(\s.*\)\?$/ nextgroup=VimwikiPlaceholderParam skipwhite syntax match VimwikiPlaceholder /^\s*%link\ze\%(\s.*\)\?$/ nextgroup=VimwikiPlaceholderParam skipwhite
''; '';
# Private mode plugin for concealing buffer content (out of store symlink for live editing)
home.file.".config/nvim/lua/private-mode.lua".source = config.lib.file.mkOutOfStoreSymlink "${toString ./.}/private-mode.lua";
#environment.systemPackages = with customPlugins; [ tidal ]; #environment.systemPackages = with customPlugins; [ tidal ];
programs.neovim = { programs.neovim = {
enable = true; enable = true;
@ -237,7 +224,6 @@ in
nnoremap <leader>fb <cmd>Telescope buffers<cr> nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr> nnoremap <leader>fh <cmd>Telescope help_tags<cr>
nnoremap <leader>ft <cmd>Telescope tags<cr> nnoremap <leader>ft <cmd>Telescope tags<cr>
nnoremap <leader>fr <cmd>lua KitaabRecent()<cr>
" exit normal mode in terminal " exit normal mode in terminal
:tnoremap <C-n> <C-\><C-n> :tnoremap <C-n> <C-\><C-n>
@ -331,10 +317,10 @@ in
let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.8 } } let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.8 } }
" lsp commands " lsp commands
nnoremap gd :lua vim.lsp.buf.definition()<CR> nnoremap <leader>vgd :lua vim.lsp.buf.definition()<CR>
nnoremap gI :lua require('telescope.builtin').lsp_implementation()<CR> nnoremap <leader>vi :lua require('telescope.builtin').lsp_implementation()<CR>
nnoremap gK :lua vim.lsp.buf.signature_help()<CR> nnoremap <leader>vsh :lua vim.lsp.buf.signature_help()<CR>
nnoremap gr :lua require('telescope.builtin').lsp_references()<CR> nnoremap <leader>vrr :lua require('telescope.builtin').lsp_references()<CR>
" nnoremap <leader>vrn :lua vim.lsp.buf.rename()<CR> " nnoremap <leader>vrn :lua vim.lsp.buf.rename()<CR>
" nnoremap <leader>vh :lua vim.lsp.buf.hover()<CR> " nnoremap <leader>vh :lua vim.lsp.buf.hover()<CR>
" nnoremap <leader>vca :lua vim.lsp.buf.code_action()<CR> " nnoremap <leader>vca :lua vim.lsp.buf.code_action()<CR>
@ -343,9 +329,9 @@ in
" nnoremap <leader>va :lua require('telescope.builtin').lsp_code_actions(require('telescope.themes').get_cursor())<cr> " nnoremap <leader>va :lua require('telescope.builtin').lsp_code_actions(require('telescope.themes').get_cursor())<cr>
" lspsaga stuff doesn't work " lspsaga stuff doesn't work
nnoremap <leader>vd :Lspsaga peek_definition<CR> nnoremap <leader>vd :Lspsaga peek_definition<CR>
nnoremap <leader>cr :Lspsaga rename<CR><CR> nnoremap <leader>vrn :Lspsaga rename<CR><CR>
nnoremap K :Lspsaga hover_doc<CR> nnoremap <leader>vh :Lspsaga hover_doc<CR>
nnoremap <leader>ca :Lspsaga code_action<CR> nnoremap <leader>vca :Lspsaga code_action<CR>
nnoremap <leader>vsd :Lspsaga show_line_diagnostics<CR> nnoremap <leader>vsd :Lspsaga show_line_diagnostics<CR>
nnoremap <leader>vs :Dasht<Space> nnoremap <leader>vs :Dasht<Space>
nnoremap <leader>vn :Lspsaga diagnostic_jump_prev<CR> nnoremap <leader>vn :Lspsaga diagnostic_jump_prev<CR>
@ -499,10 +485,6 @@ in
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end end
-- private mode
-- Setup private mode
require('private-mode').setup({ keymap = '<leader>pm' })
local luasnip = require("luasnip") local luasnip = require("luasnip")
local lspkind = require("lspkind") local lspkind = require("lspkind")
local cmp = require('cmp') local cmp = require('cmp')
@ -720,7 +702,7 @@ in
} }
} }
local servers = { 'clojure_lsp', 'terraform_lsp', 'zls', 'pyright', 'rust_analyzer', 'ts_ls', 'lua_ls', 'gopls', 'bashls'} local servers = { 'clojure_lsp', 'terraform_lsp', 'zls', 'pyright', 'rust_analyzer', 'ts_ls', 'lua_ls', 'nil_ls', 'gopls', 'bashls'}
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do
lspconfig[lsp].setup { lspconfig[lsp].setup {
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
@ -730,23 +712,6 @@ in
} }
end end
-- nil_ls needs custom settings to disable autoArchive prompt
lspconfig['nil_ls'].setup {
on_attach = function(client, bufnr)
navic.attach(client, bufnr)
end,
capabilities = capabilities,
settings = {
['nil'] = {
nix = {
flake = {
autoArchive = false,
},
},
},
},
}
-- fennel-ls doesn't support navic -- fennel-ls doesn't support navic
lspconfig['fennel-ls'].setup { lspconfig['fennel-ls'].setup {
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
@ -881,6 +846,21 @@ in
require("which-key").setup{} require("which-key").setup{}
require('leap').set_default_keymaps() require('leap').set_default_keymaps()
${lib.optionalString (customPlugins.amp-nvim != null) ''
-- Setup amp.nvim
require('amp').setup({
auto_start = true,
log_level = "info",
completion_enabled = true
})
-- require('amp.completion').setup({
-- keymaps = {
-- accept = "<C-y>",
-- dismiss = "<C-n>",
-- }
-- })
''}
-- supercollider -- supercollider
local scnvim = require 'scnvim' local scnvim = require 'scnvim'
local map = scnvim.map local map = scnvim.map
@ -939,7 +919,7 @@ in
map("n", "<leader>zl", "<Cmd>ZkLinks<CR>", opts) map("n", "<leader>zl", "<Cmd>ZkLinks<CR>", opts)
-- Preview a linked note. -- Preview a linked note.
map("n", "<leader>ck", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts) map("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
-- Open the code actions for a visual selection. -- Open the code actions for a visual selection.
map("v", "<leader>za", ":'<,'>lua vim.lsp.buf.range_code_action()<CR>", opts) map("v", "<leader>za", ":'<,'>lua vim.lsp.buf.range_code_action()<CR>", opts)
@ -1032,8 +1012,8 @@ in
vim.keymap.set({'n', 't'}, '<M-k>', '<CMD>NavigatorUp<CR>') vim.keymap.set({'n', 't'}, '<M-k>', '<CMD>NavigatorUp<CR>')
vim.keymap.set({'n', 't'}, '<M-l>', '<CMD>NavigatorRight<CR>') vim.keymap.set({'n', 't'}, '<M-l>', '<CMD>NavigatorRight<CR>')
-- Paste from system clipboard in insert mode (handles tmux/kitty better) -- Disable Ctrl+V in nvim so Kitty can handle paste
vim.keymap.set('i', '<C-v>', '<C-r><C-p>+', {noremap = true, silent = true}) vim.keymap.set({'v', 'i'}, '<C-v>', '<Nop>', {noremap = true, silent = true})
-- Pane resizing with Alt+Shift+hjkl (to match tmux) -- Pane resizing with Alt+Shift+hjkl (to match tmux)
vim.keymap.set('n', '<M-S-h>', '<Cmd>vertical resize -2<CR>', {silent = true}) vim.keymap.set('n', '<M-S-h>', '<Cmd>vertical resize -2<CR>', {silent = true})
@ -1041,65 +1021,6 @@ in
vim.keymap.set('n', '<M-S-k>', '<Cmd>resize +2<CR>', {silent = true}) vim.keymap.set('n', '<M-S-k>', '<Cmd>resize +2<CR>', {silent = true})
vim.keymap.set('n', '<M-S-l>', '<Cmd>vertical resize +2<CR>', {silent = true}) vim.keymap.set('n', '<M-S-l>', '<Cmd>vertical resize +2<CR>', {silent = true})
-- opencode.nvim setup with tmux provider
vim.g.opencode_opts = {
provider = {
enabled = "tmux",
tmux = {
-- default tmux provider settings work well
},
},
}
-- opencode.nvim keybindings
vim.keymap.set({ "n", "x" }, "<leader>oa", function() require("opencode").ask("@this: ") end, { desc = "Ask opencode" })
vim.keymap.set({ "n", "x" }, "<leader>os", function() require("opencode").select() end, { desc = "Select opencode action" })
vim.keymap.set({ "n", "t" }, "<leader>oo", function() require("opencode").toggle() end, { desc = "Toggle opencode" })
vim.keymap.set({ "n", "x" }, "<leader>op", function() return require("opencode").operator("@this ") end, { expr = true, desc = "Add range to opencode" })
-- Kitaab recent files (only date-based files, sorted reverse)
function KitaabRecent()
local pickers = require('telescope.pickers')
local finders = require('telescope.finders')
local conf = require('telescope.config').values
-- Use current working directory
local kitaab_path = vim.fn.getcwd()
-- Get all files (depth 1, exclude directories)
local files = vim.fn.readdir(kitaab_path, function(name)
return vim.fn.isdirectory(kitaab_path .. '/' .. name) == 0
end)
-- Filter to only date-based files (starting with digit)
local date_files = {}
for _, filename in ipairs(files) do
if filename:match('^%d') then
table.insert(date_files, filename)
end
end
-- Sort in reverse (most recent first)
table.sort(date_files, function(a, b) return a > b end)
pickers.new({}, {
prompt_title = 'Kitaab Recent',
finder = finders.new_table({
results = date_files,
entry_maker = function(entry)
return {
value = kitaab_path .. '/' .. entry,
display = entry,
ordinal = entry,
path = kitaab_path .. '/' .. entry,
}
end
}),
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
}):find()
end
EOF EOF
''; '';
@ -1218,13 +1139,12 @@ in
# custom # custom
yuck-vim yuck-vim
nvim-parinfer nvim-parinfer
# opencode integration
opencode-nvim
# vim-processing # vim-processing
] ++ lib.optionals pkgs.stdenv.isLinux [ ] ++ lib.optionals pkgs.stdenv.isLinux [
# Linux-only plugins # Linux-only plugins
vim-tidal # requires SuperCollider which is Linux-only vim-tidal # requires SuperCollider which is Linux-only
] ++ lib.optionals (customPlugins.amp-nvim != null) [
customPlugins.amp-nvim
]; ];
withPython3 = true; withPython3 = true;
extraPython3Packages = pkgs: with pkgs; [ tasklib six packaging ]; extraPython3Packages = pkgs: with pkgs; [ tasklib six packaging ];
@ -1232,4 +1152,3 @@ in
}; };
} }

View file

@ -1,95 +0,0 @@
local M = {}
local ns_id = vim.api.nvim_create_namespace('private_mode')
local enabled = false
local concealed_char = '' -- Character to show instead of text
local function conceal_buffer()
local buf = vim.api.nvim_get_current_buf()
local line_count = vim.api.nvim_buf_line_count(buf)
vim.api.nvim_buf_clear_namespace(buf, ns_id, 0, -1)
for i = 0, line_count - 1 do
local line = vim.api.nvim_buf_get_lines(buf, i, i + 1, false)[1]
if line and #line > 0 then
-- Conceal each character individually
for col = 0, #line - 1 do
vim.api.nvim_buf_set_extmark(buf, ns_id, i, col, {
end_col = col + 1,
conceal = concealed_char,
})
end
end
end
end
local function reveal_current_line()
local buf = vim.api.nvim_get_current_buf()
local cursor = vim.api.nvim_win_get_cursor(0)
local current_line = cursor[1] - 1
-- Clear concealment for current line only
vim.api.nvim_buf_clear_namespace(buf, ns_id, current_line, current_line + 1)
end
local function update_display()
if not enabled then return end
conceal_buffer()
local mode = vim.fn.mode()
-- Reveal current line in insert mode
if mode == 'i' or mode == 'R' then
reveal_current_line()
end
end
function M.toggle()
enabled = not enabled
if enabled then
-- Set concealment options
vim.opt_local.conceallevel = 2
vim.opt_local.concealcursor = 'nvc'
-- Initial concealment
update_display()
-- Set up autocommands
local group = vim.api.nvim_create_augroup('PrivateMode', { clear = true })
vim.api.nvim_create_autocmd({'ModeChanged', 'CursorMoved', 'CursorMovedI', 'TextChanged', 'TextChangedI'}, {
group = group,
callback = update_display,
})
print("Private mode enabled")
else
-- Clear all concealment
local buf = vim.api.nvim_get_current_buf()
vim.api.nvim_buf_clear_namespace(buf, ns_id, 0, -1)
-- Clear autocommands
vim.api.nvim_create_augroup('PrivateMode', { clear = true })
print("Private mode disabled")
end
end
function M.setup(opts)
opts = opts or {}
concealed_char = opts.conceal_char or ''
-- Create user command
vim.api.nvim_create_user_command('PrivateMode', function()
M.toggle()
end, {})
-- Optional: Set up a keybinding
if opts.keymap then
vim.keymap.set('n', opts.keymap, M.toggle, { desc = 'Toggle private mode' })
end
end
return M

View file

@ -1,141 +0,0 @@
---
description: A specialized codebase understanding agent that helps answer questions about large, complex codebases across GitHub repositories. Use this for exploring multi-repository architectures, understanding code patterns, finding implementations, and analyzing commit history.
mode: subagent
model: anthropic/claude-haiku-4-5
temperature: 0.1
tools:
"*": false
github_*: true
---
You are the Librarian, a specialized codebase understanding agent that helps users answer questions about large, complex codebases across repositories.
Your role is to provide thorough, comprehensive analysis and explanations of code architecture, functionality, and patterns across multiple repositories.
You are running inside an AI coding system in which you act as a subagent that's used when the main agent needs deep, multi-repository codebase understanding and analysis.
## Key Responsibilities
- Explore repositories to answer questions
- Understand and explain architectural patterns and relationships across repositories
- Find specific implementations and trace code flow across codebases
- Explain how features work end-to-end across multiple repositories
- Understand code evolution through commit history
- Create visual diagrams when helpful for understanding complex systems
## Guidelines
- Use available GitHub MCP tools extensively to explore repositories
- Execute tools in parallel when possible for efficiency
- Read files thoroughly to understand implementation details
- Search for patterns and related code across multiple repositories
- Use commit listing to understand how code evolved over time
- Focus on thorough understanding and comprehensive explanation across repositories
- Create mermaid diagrams to visualize complex relationships or flows
## Available Tools (GitHub MCP)
You have access to the following GitHub MCP tools:
### Reading & Exploring
- `github_get_file_contents`: Read file or directory contents from a repository
- For directories, the path must end with `/`
- Parameters: `owner`, `repo`, `path`, `ref` (optional branch/tag)
- `github_get_repository_tree`: List all files in a repository with optional path filtering
- Use `recursive: true` to get all files
- Use `path_filter` to filter by path prefix
- Parameters: `owner`, `repo`, `recursive`, `path_filter`, `tree_sha`
- `github_list_branches`: List branches in a repository
- `github_list_tags`: List tags in a repository
### Searching
- `github_search_code`: Search for code patterns across repositories
- Use GitHub's search syntax: `pattern repo:owner/repo language:typescript path:src/`
- Combine with AND, OR, NOT operators
- Parameters: `query`, `perPage`, `page`
- `github_search_repositories`: Find repositories by name, org, language, etc.
- Use query syntax: `name org:orgname language:typescript`
- Parameters: `query`, `perPage`, `page`
### Commit History
- `github_list_commits`: View commit history for a repository
- Parameters: `owner`, `repo`, `sha` (branch/tag), `author`, `perPage`, `page`
- `github_get_commit`: Get detailed commit information including diffs
- Set `include_diff: true` for file changes
- Parameters: `owner`, `repo`, `sha`, `include_diff`
## Tool Usage Guidelines
You should use all available tools to thoroughly explore the codebase before answering.
Use tools in parallel whenever possible for efficiency.
When searching code, use GitHub's search syntax:
- `"pattern repo:owner/repo"` to search a specific repo
- `"pattern language:typescript"` to filter by language
- `"pattern path:src/"` to filter by directory
- Combine with AND, OR, NOT operators (max 5 operators)
When exploring file structure:
- Use `github_get_repository_tree` with `recursive: true` to see all files
- Use `github_get_file_contents` with a path ending in `/` to list directory contents
- Read key files like README.md, package.json, or main entry points first
## Communication
You must use Markdown for formatting your responses.
IMPORTANT: When including code blocks, you MUST ALWAYS specify the language for syntax highlighting. Always add the language identifier after the opening backticks.
NEVER refer to tools by their names. Example: NEVER say "I can use the github_get_file_contents tool", instead say "I'm going to read the file"
### Direct & Detailed Communication
You should only address the user's specific query or task at hand. Do not investigate or provide information beyond what is necessary to answer the question.
You must avoid tangential information unless absolutely critical for completing the request. Avoid long introductions, explanations, and summaries. Avoid unnecessary preamble or postamble, unless the user asks you to.
Answer the user's question directly, without elaboration, explanation, or details. You MUST avoid text before/after your response, such as "The answer is <answer>.", "Here is the content of the file..." or "Based on the information provided, the answer is..." or "Here is what I will do next...".
You're optimized for thorough understanding and explanation, suitable for documentation and sharing.
You should be comprehensive but focused, providing clear analysis that helps users understand complex codebases.
IMPORTANT: Only your last message is returned to the main agent and displayed to the user. Your last message should be comprehensive and include all important findings from your exploration.
## Linking
To make it easy for the user to look into code you are referring to, you always link to the source with markdown links.
For files or directories, the URL should look like:
`https://github.com/<org>/<repository>/blob/<revision>/<filepath>#L<range>`
Where:
- `<org>` is the organization or user
- `<repository>` is the repository name
- `<revision>` is the branch or commit SHA (use `main` or `master` if not specified)
- `<filepath>` is the absolute path to the file
- `<range>` is an optional fragment with the line range (e.g., `L32-L42`)
Example: `https://github.com/foo_org/bar_repo/blob/develop/src/test.py#L32-L42`
Prefer "fluent" linking style. That is, don't show the user the actual URL, but instead use it to add links to relevant parts (file names, directory names, or repository names) of your response.
Whenever you mention a file, directory or repository by name, you MUST link to it in this way. ONLY link if the mention is by name.
## Examples
When asked "How does authentication work in the Kubernetes codebase?":
1. Search for authentication-related code
2. Read key files to understand the implementation
3. Trace the code flow
4. Provide a comprehensive explanation with links to source files
When asked "Find how database migrations are handled in Rails":
1. Search the Rails repository for migration-related code
2. Explore the directory structure
3. Read migration runner and generator files
4. Explain the migration system with code references

View file

@ -1,52 +0,0 @@
{ pkgs, lib, inputs, ... }:
let
# Paths to agenix-decrypted secrets (same on Darwin and NixOS)
githubToken = "/run/agenix/github-token";
anthropicToken = "/run/agenix/anthropicToken";
# github-mcp-server binary path from nixpkgs
githubMcpServer = "${pkgs.github-mcp-server}/bin/github-mcp-server";
in
{
home.packages = [
pkgs.github-mcp-server
inputs.llm-agents.packages.${pkgs.system}.opencode
inputs.llm-agents.packages.${pkgs.system}.beads
];
# OpenCode configuration directory
xdg.configFile = {
"opencode/opencode.json".text = builtins.toJSON {
"$schema" = "https://opencode.ai/config.json";
theme = "ayu-mirage";
autoupdate = false;
permission = {
external_directory = "allow";
};
provider = {
anthropic = {
options = {
apiKey = "{file:${anthropicToken}}";
};
};
};
mcp = {
github = {
type = "local";
command = [ githubMcpServer "stdio" ];
environment = {
GITHUB_PERSONAL_ACCESS_TOKEN = "{file:${githubToken}}";
};
};
};
agent = {
build.tools."github_*" = false;
plan.tools."github_*" = false;
};
};
"opencode/themes/ayu-mirage.json".source = ./themes/ayu-mirage.json;
"opencode/agent/librarian.md".source = ./agent/librarian.md;
};
}

View file

@ -1,80 +0,0 @@
{
"$schema": "https://opencode.ai/theme.json",
"defs": {
"darkBg": "#1f2430",
"darkBgAlt": "#242936",
"darkLine": "#171b24",
"darkPanel": "#1c212b",
"darkFg": "#cccac2",
"darkFgMuted": "#707a8c",
"darkGutter": "#8a919966",
"darkTag": "#5ccfe6",
"darkFunc": "#ffd173",
"darkEntity": "#73d0ff",
"darkString": "#d5ff80",
"darkRegexp": "#95e6cb",
"darkMarkup": "#f28779",
"darkKeyword": "#ffad66",
"darkSpecial": "#ffdfb3",
"darkComment": "#b8cfe680",
"darkConstant": "#dfbfffb3",
"darkOperator": "#f29e7480",
"darkAdded": "#87d96cb3",
"darkRemoved": "#f27983b3",
"darkAccent": "#ffcc66b3",
"darkError": "#ff6666",
"darkIndentActive": "#8a919959"
},
"theme": {
"primary": "darkEntity",
"secondary": "darkConstant",
"accent": "darkAccent",
"error": "darkError",
"warning": "darkSpecial",
"success": "darkAdded",
"info": "darkTag",
"text": "darkFg",
"textMuted": "darkFgMuted",
"background": "darkBg",
"backgroundPanel": "darkPanel",
"backgroundElement": "darkBgAlt",
"border": "darkGutter",
"borderActive": "darkIndentActive",
"borderSubtle": "darkLine",
"diffAdded": "darkAdded",
"diffRemoved": "darkRemoved",
"diffContext": "darkComment",
"diffHunkHeader": "darkComment",
"diffHighlightAdded": "darkString",
"diffHighlightRemoved": "darkMarkup",
"diffAddedBg": "#20303b",
"diffRemovedBg": "#37222c",
"diffContextBg": "darkPanel",
"diffLineNumber": "darkGutter",
"diffAddedLineNumberBg": "#1b2b34",
"diffRemovedLineNumberBg": "#2d1f26",
"markdownText": "darkFg",
"markdownHeading": "darkConstant",
"markdownLink": "darkEntity",
"markdownLinkText": "darkTag",
"markdownCode": "darkString",
"markdownBlockQuote": "darkSpecial",
"markdownEmph": "darkSpecial",
"markdownStrong": "darkFunc",
"markdownHorizontalRule": "darkFgMuted",
"markdownListItem": "darkEntity",
"markdownListEnumeration": "darkTag",
"markdownImage": "darkEntity",
"markdownImageText": "darkTag",
"markdownCodeBlock": "darkFg",
"syntaxComment": "darkComment",
"syntaxKeyword": "darkKeyword",
"syntaxFunction": "darkFunc",
"syntaxVariable": "darkEntity",
"syntaxString": "darkString",
"syntaxNumber": "darkConstant",
"syntaxType": "darkSpecial",
"syntaxOperator": "darkOperator",
"syntaxPunctuation": "darkFg"
}
}

View file

@ -2,37 +2,10 @@ set -g base-index 1
setw -g pane-base-index 1 setw -g pane-base-index 1
# https://old.reddit.com/r/tmux/comments/mesrci/tmux_2_doesnt_seem_to_use_256_colors/ # https://old.reddit.com/r/tmux/comments/mesrci/tmux_2_doesnt_seem_to_use_256_colors/
# colors set -g default-terminal "xterm-256color"
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc" set -ga terminal-overrides ",*256col*:Tc"
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set-environment -g COLORTERM "truecolor" set-environment -g COLORTERM "truecolor"
set -sa terminal-features ",tmux-256color:RGB:Nobr"
set -g allow-passthrough on
set -g set-clipboard on
# shift enter for amp
set -s extended-keys on
set -as terminal-features 'tmux*:extkeys'
# pane colors for amp diff view
# set-option -g pane-colours[0] "#4D5566"
# set-option -g pane-colours[1] "#F27983"
# set-option -g pane-colours[2] "#A6CC70"
# set-option -g pane-colours[3] "#F29E74"
# set-option -g pane-colours[4] "#77A8D9"
# set-option -g pane-colours[5] "#A37ACC"
# set-option -g pane-colours[6] "#4CBF99"
# set-option -g pane-colours[7] "#F0F0F0"
# set-option -g pane-colours[8] "#000000"
# set-option -g pane-colours[9] "#FF3333"
# set-option -g pane-colours[10] "#BAE67E"
# set-option -g pane-colours[11] "#FFA759"
# set-option -g pane-colours[12] "#73D0FF"
# set-option -g pane-colours[13] "#D4BFFF"
# set-option -g pane-colours[14] "#95E6CB"
# set-option -g pane-colours[15] "#ffffff"
# Mouse works as expected # Mouse works as expected
set-option -g mouse on set-option -g mouse on
@ -43,10 +16,6 @@ set -g focus-events on
bind | split-window -h -c "#{pane_current_path}" bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}" bind - split-window -v -c "#{pane_current_path}"
# amp commands
set -g @amp/fork-thread-command 'new-window -n forked-thread $SHELL -c "amp threads fork; amp threads continue"'
bind -N 'Fork Amp thread' f "#{@amp/fork-thread-command}"
# don't rename windows automatically # don't rename windows automatically
set-option -g allow-rename off set-option -g allow-rename off
@ -94,7 +63,6 @@ set -g message-style 'fg=yellow bg=green bold'
# Unbind Ctrl+V so it passes through to Kitty for paste # Unbind Ctrl+V so it passes through to Kitty for paste
unbind C-v unbind C-v
set -g set-clipboard on
# Vim-aware pane navigation with Alt+hjkl # Vim-aware pane navigation with Alt+hjkl
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"

View file

@ -91,6 +91,7 @@
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
services.openssh.enable = true; services.openssh.enable = true;
networking.firewall.allowedTCPPorts = [ 22 ];
programs.gnupg.agent.enable = true; programs.gnupg.agent.enable = true;
programs.gnupg.agent.pinentryPackage = pkgs.pinentry-curses; programs.gnupg.agent.pinentryPackage = pkgs.pinentry-curses;

View file

@ -18,7 +18,6 @@
../profiles/wallabag ../profiles/wallabag
../profiles/finance ../profiles/finance
../profiles/sync/website ../profiles/sync/website
../profiles/sync/music
../profiles/grasp ../profiles/grasp
# ../profiles/archivebox # ../profiles/archivebox
# ../profiles/woodpecker-agent # ../profiles/woodpecker-agent
@ -28,7 +27,6 @@
../profiles/jacket ../profiles/jacket
../profiles/gpodder ../profiles/gpodder
../profiles/transmission ../profiles/transmission
../profiles/raven
#../profiles/postgres_upgrade_script #../profiles/postgres_upgrade_script
]; ];
@ -58,19 +56,6 @@
# seafile # seafile
}; };
# opencode-manager ports
networking.firewall = {
allowedTCPPorts = [
5003 # opencode-manager backend
5173 # opencode-manager frontend
5551 # opencode server
];
allowedTCPPortRanges = [{
from = 7000;
to = 9000;
}]; # ports for testing user changes
};
environment.systemPackages = with pkgs; [ lm_sensors ]; environment.systemPackages = with pkgs; [ lm_sensors ];
hardware.fancontrol = { hardware.fancontrol = {
enable = false; enable = false;
@ -80,10 +65,6 @@
age.secrets.box-wg.file = "${self}/secrets/box-wg.age"; age.secrets.box-wg.file = "${self}/secrets/box-wg.age";
age.secrets.box-wg.owner = "anish"; age.secrets.box-wg.owner = "anish";
age.secrets.borg-key.file = "${self}/secrets/borg-key.age"; age.secrets.borg-key.file = "${self}/secrets/borg-key.age";
age.secrets.github-token.file = "${self}/secrets/github-token.age";
age.secrets.github-token.owner = "anish";
age.secrets.anthropicToken.file = "${self}/secrets/anthropicToken.age";
age.secrets.anthropicToken.owner = "anish";
mossnet.wg = { mossnet.wg = {
enable = true; enable = true;
ips = [ "10.0.69.4/24" ]; ips = [ "10.0.69.4/24" ];

View file

@ -23,15 +23,12 @@
settings.PermitRootLogin = "no"; settings.PermitRootLogin = "no";
}; };
hardware.keyboard.qmk.enable = true;
services.udev.packages = with pkgs; [ via ];
# import profiling tools # import profiling tools
programs.systemtap.enable = true; programs.systemtap.enable = true;
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
virtualisation.docker.storageDriver = "btrfs"; virtualisation.docker.storageDriver = "btrfs";
environment.systemPackages = with pkgs; [ docker-compose via ]; environment.systemPackages = with pkgs; [ docker-compose ];
# Speed up boot by removing dependency on network # Speed up boot by removing dependency on network
systemd = { systemd = {
@ -72,7 +69,7 @@
# lazy enable of ports necessary for KDE connect which is installed via cli home profile (for some reason?) # lazy enable of ports necessary for KDE connect which is installed via cli home profile (for some reason?)
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 22 4173 3000 ]; # allow ssh and vibekanban allowedTCPPorts = [ 22 4173 ]; # allow ssh
allowedTCPPortRanges = [{ allowedTCPPortRanges = [{
from = 1714; from = 1714;
to = 1764; to = 1764;
@ -85,10 +82,6 @@
age.secrets.curve-wg.file = "${self}/secrets/curve-wg.age"; age.secrets.curve-wg.file = "${self}/secrets/curve-wg.age";
age.secrets.curve-wg.owner = "anish"; age.secrets.curve-wg.owner = "anish";
age.secrets.github-token.file = "${self}/secrets/github-token.age";
age.secrets.github-token.owner = "anish";
age.secrets.anthropicToken.file = "${self}/secrets/anthropicToken.age";
age.secrets.anthropicToken.owner = "anish";
mossnet.wg = { mossnet.wg = {
enable = true; enable = true;
ips = [ "10.0.69.2/24" ]; ips = [ "10.0.69.2/24" ];

View file

@ -1,4 +1,4 @@
{ self, pkgs, config, inputs, ... }: { self, pkgs, config, ... }:
{ {
imports = [ imports = [
@ -22,10 +22,6 @@
age.identityPaths = [ "/Users/anishlakhwara/.ssh/id_ed25519" ]; age.identityPaths = [ "/Users/anishlakhwara/.ssh/id_ed25519" ];
age.secrets.work-wg.file = "${self}/secrets/work-wg.age"; age.secrets.work-wg.file = "${self}/secrets/work-wg.age";
age.secrets.work-wg.owner = "anishlakhwara"; age.secrets.work-wg.owner = "anishlakhwara";
age.secrets.github-token.file = "${self}/secrets/github-token.age";
age.secrets.github-token.owner = "anishlakhwara";
age.secrets.anthropicToken.file = "${self}/secrets/anthropicToken.age";
age.secrets.anthropicToken.owner = "anishlakhwara";
networking.wg-quick.interfaces = { networking.wg-quick.interfaces = {
wg0 = { wg0 = {
address = [ "10.0.69.7/24" ]; address = [ "10.0.69.7/24" ];

View file

@ -73,9 +73,8 @@
# }; # };
# Enable automatic login for the user. # Enable automatic login for the user.
# Disabled: jovian.steam.autoStart handles this services.xserver.displayManager.autoLogin.enable = true;
# services.xserver.displayManager.autoLogin.enable = true; services.xserver.displayManager.autoLogin.user = "anish";
# services.xserver.displayManager.autoLogin.user = "anish";
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229 # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
systemd.services."getty@tty1".enable = false; systemd.services."getty@tty1".enable = false;

View file

@ -1,4 +1,4 @@
{ self, pkgs, config, lib, ... }: { self, pkgs, config, ... }:
{ {
imports = [ imports = [
./configuration.nix ./configuration.nix
@ -8,7 +8,7 @@
# ../profiles/music # ../profiles/music
../profiles/sync/cal ../profiles/sync/cal
../profiles/wifi ../profiles/wifi
# ../profiles/desktop # Disabled: conflicts with jovian desktop manager ../profiles/desktop
../profiles/mimetypes ../profiles/mimetypes
../profiles/syncthing ../profiles/syncthing
../profiles/mossnet-hosts ../profiles/mossnet-hosts
@ -35,10 +35,8 @@
jovian.devices.steamdeck.enable = true; jovian.devices.steamdeck.enable = true;
jovian.steam.user = "anish"; jovian.steam.user = "anish";
jovian.steam.autoStart = true; jovian.steam.autoStart = true;
jovian.steam.desktopSession = "gamescope-wayland"; jovian.steam.desktopSession = "gnome";
# jovian.steam.desktopSession = "none+bspwm";
# Disable lightdm from desktop profile
services.xserver.displayManager.lightdm.enable = lib.mkForce false;
# Install XR drivers # Install XR drivers
# environment.systemPackages = with pkgs; [ # environment.systemPackages = with pkgs; [

View file

@ -1,53 +0,0 @@
{ config, lib, pkgs, ... }:
{
# Block storage mount
fileSystems."/srv/sealight" = {
device = "/dev/disk/by-id/virtio-mel-3b1f60a89cd649";
fsType = "ext4";
options = [ "noatime" ];
};
# Bind mounts for service data
# PostgreSQL moved to NVMe for performance - data lives directly on /var/lib/postgresql
# fileSystems."/var/lib/postgresql" = {
# device = "/srv/sealight/postgresql";
# fsType = "none";
# options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ];
# };
fileSystems."/var/lib/matrix-synapse" = {
device = "/srv/sealight/matrix-synapse";
fsType = "none";
options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ];
};
fileSystems."/var/lib/matrix-as-discord" = {
device = "/srv/sealight/matrix-as-discord";
fsType = "none";
options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ];
};
fileSystems."/var/lib/mautrix-telegram" = {
device = "/srv/sealight/mautrix-telegram";
fsType = "none";
options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ];
};
fileSystems."/var/lib/wireguard" = {
device = "/srv/sealight/wireguard";
fsType = "none";
options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ];
};
fileSystems."/var/www" = {
device = "/srv/sealight/www";
fsType = "none";
options = [ "bind" "x-systemd.requires-mounts-for=/srv/sealight" ];
};
# Ensure services wait for mounts
# PostgreSQL no longer needs to wait for /srv/sealight mount
# systemd.services.postgresql.unitConfig.RequiresMountsFor = [ "/srv/sealight" ];
systemd.services.matrix-synapse.unitConfig.RequiresMountsFor = [ "/srv/sealight" ];
}

View file

@ -1,9 +1,7 @@
{ self, profiles, suites, ... }: { self, profiles, suites, ... }:
{ {
imports = [ imports = [
./hardware-configuration.nix
./configuration.nix ./configuration.nix
./block-storage.nix
../profiles/core ../profiles/core
../profiles/server ../profiles/server
../profiles/metrics ../profiles/metrics

View file

@ -1,22 +1,27 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
imports = [ ]; imports =
[
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ]; boot.initrd.availableKernelModules = [ "ata_piix" "floppy" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" =
device = "/dev/disk/by-uuid/f9e9468f-ff3b-430d-9ecf-ba275cf2f716"; {
fsType = "ext4"; device = "/dev/disk/by-uuid/3b8b2c4b-835e-4822-8ac8-0effdc8270d6";
}; fsType = "btrfs";
};
swapDevices = [ ]; swapDevices = [ ];
networking.useDHCP = lib.mkDefault true; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
nixpkgs.hostPlatform = "x86_64-linux";
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
virtualisation.hypervGuest.enable = true;
} }

View file

@ -57,6 +57,7 @@ in {
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
#unstable.sublime-music
# olm-3.2.16 is now insecure # olm-3.2.16 is now insecure
# some reason I can't set insecure packages that will be respected # some reason I can't set insecure packages that will be respected
nheko nheko
@ -65,7 +66,8 @@ in {
unstable.newsflash unstable.newsflash
unstable.liferea unstable.liferea
unstable.gh unstable.gh
flyctl unstable.flyctl
unstable.sublime-music
kooha kooha
light light
@ -96,7 +98,6 @@ in {
# tic-80 # tic-80
ytfzf ytfzf
yt-dlp yt-dlp
# autohide-tdrop
]; ];
xdg.portal = { xdg.portal = {

View file

@ -1,6 +1,5 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
environment.systemPackages = [ pkgs.ffmpeg ];
mossnet.gonic.enable = true; mossnet.gonic.enable = true;
mossnet.gonic.settings = '' mossnet.gonic.settings = ''
music-path /mnt/two/music/ music-path /mnt/two/music/

View file

@ -2,7 +2,6 @@
{ {
services.immich = { services.immich = {
enable = true; enable = true;
package = pkgs.unstable.immich;
database = { database = {
enable = true; enable = true;
}; };

View file

@ -17,14 +17,11 @@
age.secrets.synapse-config.file = "${self}/secrets/synapse-config.age"; age.secrets.synapse-config.file = "${self}/secrets/synapse-config.age";
age.secrets.synapse-config.owner = "matrix-synapse"; age.secrets.synapse-config.owner = "matrix-synapse";
systemd.services.matrix-synapse.serviceConfig.TimeoutStartSec = "10min";
services.matrix-synapse = { services.matrix-synapse = {
enable = true; enable = true;
settings = { settings = {
max_upload_size = "100M"; max_upload_size = "100M";
server_name = "sealight.xyz"; server_name = "sealight.xyz";
federation_sender_instances = [];
listeners = [ listeners = [
{ {
port = 8448; port = 8448;
@ -213,12 +210,7 @@
root = "/var/www/sealight.xyz"; root = "/var/www/sealight.xyz";
}; };
locations."/_matrix" = { locations."/_matrix" = {
proxyPass = "http://127.0.0.1:8448"; proxyPass = "http://localhost:8448";
extraConfig = ''
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
'';
}; };
# locations."/slackbridge" = { # locations."/slackbridge" = {
# proxyPass = "http://localhost:9899"; # proxyPass = "http://localhost:9899";
@ -230,11 +222,6 @@
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:8448"; proxyPass = "http://localhost:8448";
extraConfig = ''
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
'';
}; };
}; };
## virtual host for Riot/Web ## virtual host for Riot/Web

View file

@ -29,7 +29,6 @@
# ardour # ardour
# reaper # reaper
# renoise # renoise
bitwig-studio
]; ];
services.pulseaudio.enable = false; services.pulseaudio.enable = false;

View file

@ -14,7 +14,7 @@
exports = '' exports = ''
/home/ftp 192.168.1.0/24(rw) /home/ftp 192.168.1.0/24(rw)
/mnt/one 192.168.1.0/24(rw) /mnt/one 192.168.1.0/24(rw)
/mnt/two 192.168.1.0/24(rw,async,no_subtree_check) 10.0.69.0/24(rw,async,no_subtree_check) /mnt/two 192.168.1.0/24(rw,no_subtree_check) 10.0.69.0/24(rw,no_subtree_check)
/mnt/three 192.168.1.0/24(rw) /mnt/three 192.168.1.0/24(rw)
''; '';
}; };

View file

@ -1,61 +0,0 @@
{ pkgs, config, lib, ... }:
{
# ===================
# Ollama Service
# ===================
services.ollama = {
enable = true;
acceleration = null; # CPU only, no GPU
host = "127.0.0.1";
port = 11434;
};
# ===================
# PostgreSQL: Letta Database
# ===================
services.postgresql = {
enable = true;
ensureDatabases = [ "letta" ];
ensureUsers = [
{
name = "letta";
ensureDBOwnership = true;
}
];
# Enable TCP connections (required for Docker)
enableTCPIP = true;
# Allow letta user to connect via TCP with password
authentication = lib.mkAfter ''
# Letta database - TCP password auth for Docker
host letta letta 127.0.0.1/32 scram-sha-256
host letta letta ::1/128 scram-sha-256
'';
# pgvector is already provided by immich profile via services.immich.database.enableVectorChord
};
# ===================
# Database Setup Service
# ===================
# Runs after postgresql to enable pgvector and set password
systemd.services.raven-db-setup = {
description = "Setup Letta database with pgvector and password";
after = [ "postgresql.service" ];
wantedBy = [ "multi-user.target" ];
path = [ config.services.postgresql.package ];
serviceConfig = {
Type = "oneshot";
User = "postgres";
RemainAfterExit = true;
};
script = ''
# Enable pgvector extension
psql -d letta -c "CREATE EXTENSION IF NOT EXISTS vector;"
# Set password for letta user
# TODO: Consider using agenix for production
psql -c "ALTER USER letta WITH PASSWORD 'letta-dev-password';"
'';
};
}

View file

@ -5,19 +5,16 @@
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
path = [ path = [
pkgs.coreutils pkgs.coreutils
pkgs.openssh
pkgs.gawk
pkgs.rsync pkgs.rsync
pkgs.beets
]; ];
script = builtins.readFile ./get-music.sh; script = builtins.readFile ./get-music.sh;
serviceConfig = { serviceConfig = {
User = "anish"; User = "anish";
}; };
}; };
systemd.timers.get-music-sync = { systemd.timers.get-music-timer = {
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
partOf = [ "get-music-sync.service" ]; partOf = [ "get-music-sync.service" ];
timerConfig.OnCalendar = [ "hourly" ]; timerConfig.OnCalendar = [ "daily" ];
}; };
} }

64
hosts/profiles/sync/music/get-music.sh Executable file → Normal file
View file

@ -1,61 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
rsync -r --ignore-existing --log-file=/data/incoming/download-log hypercube@talos.feralhosting.com:private/transmission/data/* /data/incoming
set -euo pipefail # you need to set defaults for beets
# if already imported -> Skip
# Auto accept changes
# also install it lmao
#beet import /data/incoming
REMOTE_HOST="aynish@talos.feralhosting.com"
REMOTE_PATH="private/transmission/data/"
LOCAL_PATH="/mnt/two/incoming"
TRACKING_FILE="/mnt/two/incoming/.downloaded_albums"
LOG_FILE="/mnt/two/incoming/download-log"
# Create tracking file if it doesn't exist
touch "$TRACKING_FILE"
# Get list of albums on remote server
echo "$(date): Checking for new albums on seedbox..." >>"$LOG_FILE"
REMOTE_ALBUMS=$(rsync --dry-run --list-only "$REMOTE_HOST:$REMOTE_PATH" | grep '^d' | awk '{$1=$2=$3=$4=""; sub(/^ +/, ""); print}' | grep -v '^\.') || true
if [ -z "$REMOTE_ALBUMS" ]; then
echo "$(date): No albums found on remote server" >>"$LOG_FILE"
exit 0
fi
# Check each album against tracking file
NEW_ALBUMS=""
while IFS= read -r album; do
if [ -n "$album" ] && ! grep -qF "$album" "$TRACKING_FILE"; then
NEW_ALBUMS="$NEW_ALBUMS$album\n"
echo "$(date): Found new album: $album" >>"$LOG_FILE"
fi
done <<<"$REMOTE_ALBUMS"
if [ -z "$NEW_ALBUMS" ]; then
echo "$(date): No new albums to download" >>"$LOG_FILE"
exit 0
fi
# Download new albums only
echo "$(date): Starting download of new albums..." >>"$LOG_FILE"
while IFS= read -r album; do
if [ -n "$album" ]; then
echo "$(date): Downloading $album" >>"$LOG_FILE"
if rsync -r --log-file="$LOG_FILE" "$REMOTE_HOST:$REMOTE_PATH$album/" "$LOCAL_PATH/$album/"; then
echo "$album" >>"$TRACKING_FILE"
echo "$(date): Successfully downloaded $album" >>"$LOG_FILE"
# Import to beets
echo "$(date): Importing $album to beets..." >>"$LOG_FILE"
# Set umask to allow group read/write access
umask 002
if beet -p fetchart import -m -l /home/anish/music.log -q -g "$LOCAL_PATH/$album"; then
echo "$(date): Successfully imported $album to beets" >>"$LOG_FILE"
else
echo "$(date): Failed to import $album to beets" >>"$LOG_FILE"
fi
else
echo "$(date): Failed to download $album" >>"$LOG_FILE"
fi
fi
done <<<"$(echo -e "$NEW_ALBUMS")"
echo "$(date): Music sync completed" >>"$LOG_FILE"

View file

@ -50,40 +50,5 @@ in
]; ];
}; };
}; };
# Ensure WireGuard restarts on failure
systemd.services.wireguard-wg0 = {
serviceConfig = {
Restart = "on-failure";
RestartSec = "5s";
};
};
# Periodic connection health check and reconnect
systemd.services.wireguard-wg0-healthcheck = {
description = "WireGuard wg0 connection health check";
after = [ "network-online.target" "wireguard-wg0.service" ];
wants = [ "network-online.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = pkgs.writeShellScript "wg0-healthcheck" ''
# Check if we can ping the WireGuard gateway
if ! ${pkgs.iputils}/bin/ping -c 1 -W 5 10.0.69.1 &>/dev/null; then
echo "WireGuard connection down, restarting..."
${pkgs.systemd}/bin/systemctl restart wireguard-wg0.service
fi
'';
};
};
systemd.timers.wireguard-wg0-healthcheck = {
description = "Timer for WireGuard wg0 health check";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "2min";
OnUnitActiveSec = "2min";
Unit = "wireguard-wg0-healthcheck.service";
};
};
}; };
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,11 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 thu/uw UFV7xSvUrpIespNkUBz8GnPM6jkDCx9uM3Sn+lD8LRI
88nPGpjzSLCvl6Hmr+GtnptrHPNQJq/ZxM/YRcaK2RA
-> ssh-ed25519 AiezdQ 8aTzVxfR1kWRDXNKI99jD+hmxA0PJ0mdcGZbZ69ZcxU
CVja3P1tUsXwCY/CZ1bj1P0Gs0P0hQ1OIrBw3+7SgE8
-> ssh-ed25519 H6uv4Q 0y7Q+Nqm7sm5TZafXzonVonYrEWR7dqKpkfsRpnJYic
ol2NIWdBoisA+3ksO4D1YoJ2/3VTCkzJDFJikbWvW98
-> ssh-ed25519 K2vF/Q /JYJhr9DXwdiMwH0eMh/qEgL4/9yA+jb48b9AFw+qU8
mQKi2VJJ4Zr7vrjA93yMygnEwbzRupfTyFbcIMLPIsk
--- BsHEAUXzQ30O5bc7EOQUPGD/kNs5XN0ICpMQCshKWjY
ÖY…íGúpÆ6ÃÕOLWzæ lûì†ËˆÌ•HÑ„V<ë†Û`ÿK~ë£#¾<­g#o .7!Ôéº=7ÜÉ!Y'2°F¥

View file

@ -37,6 +37,4 @@ in
"wallabag-secret.age".publicKeys = [ mossnet ]; "wallabag-secret.age".publicKeys = [ mossnet ];
"work-wg.age".publicKeys = [ work user system ]; "work-wg.age".publicKeys = [ work user system ];
"github-token.age".publicKeys = [ work user system mossnet ];
"anthropicToken.age".publicKeys = [ work user system mossnet ];
} }