Compare commits

...

4 commits

Author SHA1 Message Date
Anish Lakhwara 45766ad724
Merge branch 'main' of git.sealight.xyz:aynish/helm 2025-12-13 15:51:33 -08:00
Anish Lakhwara 0645376730
more minor tweaks 2025-11-23 23:52:38 -08:00
Anish Lakhwara df8b80a2c0 Merge branch 'main' of git.sealight.xyz:aynish/helm 2025-11-21 21:09:56 -08:00
Anish Lakhwara 6edf5ecdfc idk a bunch more updates 2025-11-21 21:06:42 -08:00
13 changed files with 190 additions and 134 deletions

View file

@ -717,11 +717,11 @@
]
},
"locked": {
"lastModified": 1757230583,
"narHash": "sha256-4uqu7sFPOaVTCogsxaGMgbzZ2vK40GVGMfUmrvK3/LY=",
"lastModified": 1762951919,
"narHash": "sha256-ma/xMEGf4J6n/RdZFdxXBJUQhP53HVEPQOC6Dp2TrkQ=",
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"rev": "fc3960e6c32c9d4f95fff2ef84444284d24d3bea",
"rev": "3d248f6e8f877218dd2573fef8925ac997889922",
"type": "github"
},
"original": {
@ -1446,11 +1446,11 @@
},
"unstable": {
"locked": {
"lastModified": 1758690382,
"narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=",
"lastModified": 1762844143,
"narHash": "sha256-SlybxLZ1/e4T2lb1czEtWVzDCVSTvk9WLwGhmxFmBxI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e643668fd71b949c53f8626614b21ff71a07379d",
"rev": "9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4",
"type": "github"
},
"original": {

View file

@ -213,6 +213,8 @@
"steam"
"steam-original"
"steam-runtime"
"steamdeck-hw-theme"
"steam-jupiter-unwrapped"
];
};
overlays = [
@ -335,25 +337,26 @@
];
};
deck = unstable.lib.nixosSystem rec {
specialArgs = { inherit inputs self; };
system = "x86_64-linux";
pkgs = deckPkgsFor.${system};
modules = [
./hosts/deck
# jovian.nixosModules.default
self.nixosModules.wireguard
agenix.nixosModules.age
self.nixosModules.backup
home-manager.nixosModules.home-manager
{
nix.registry.nixpkgs.flake = unstable;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.anish = import ./home/gui;
}
];
};
# new version of unstable has many changes I couldn't be bothered to deal with rn
#deck = unstable.lib.nixosSystem rec {
# specialArgs = { inherit inputs self; };
# system = "x86_64-linux";
# pkgs = deckPkgsFor.${system};
# modules = [
# ./hosts/deck
# jovian.nixosModules.default
# self.nixosModules.wireguard
# agenix.nixosModules.age
# self.nixosModules.backup
# home-manager.nixosModules.home-manager
# {
# nix.registry.nixpkgs.flake = unstable;
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
# home-manager.users.anish = import ./home/gui;
# }
# ];
#};
};
# Darwin configuration entrypoint

View file

@ -16,15 +16,10 @@
# GPG configuration for user session
services.gpg-agent = {
enable = true;
pinentry.package = pkgs.pinentry-rofi; # Use rofi for consistency with desktop theme
pinentryPackage = pkgs.pinentry-curses;
enableSshSupport = true;
defaultCacheTtl = 28800; # 8 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 = {

View file

@ -31,7 +31,7 @@
bat
fd
ncdu
du-dust
dust
# dia-cli
duf
trash-cli
@ -64,6 +64,7 @@
taskwarrior-tui
# vimwiki-cli
zk
unstable.opencode
(pkgs.writeScriptBin "jq-repl" ''
#!/usr/bin/env bash
@ -310,7 +311,7 @@
if [[ "$OSTYPE" == "darwin"* ]]; then
cd ~/usr/helm && sudo darwin-rebuild switch --impure --flake ".#Anishs-MacBook-Pro" && cd $OLDPWD
else
cd /tmp && sudo nixos-rebuild switch --flake --impure '/home/anish/usr/helm#curve' && cd $OLDPWD
cd /tmp && sudo nixos-rebuild switch --impure --flake '/home/anish/usr/helm#curve' && cd $OLDPWD
fi
'';
nrt = "cd /tmp; sudo nixos-rebuild test --flake '/home/anish/usr/helm#curve'; cd $OLDPWD";

View file

@ -18,8 +18,8 @@
userEmail = "anish+git@lakhwara.com";
delta.enable = true;
signing = {
signByDefault = true;
key = "7FC5DF072EF7B716";
signByDefault = if pkgs.stdenv.isLinux then false else true;
key = if pkgs.stdenv.isLinux then "B8492C8FB53397B7" else "7FC5DF072EF7B716";
};
ignores = [

View file

@ -1,4 +1,4 @@
{ lib, pkgs, ... }:
{ pkgs, lib, config, ... }:
let
customPlugins = {
vim-zettel = pkgs.vimUtils.buildVimPlugin {
@ -11,16 +11,6 @@ let
};
};
amp-nvim = pkgs.vimUtils.buildVimPlugin {
name = "amp-nvim";
src = pkgs.fetchFromGitHub {
owner = "sourcegraph";
repo = "amp.nvim";
rev = "main";
sha256 = "Sm/SQEIZlnqu/sD+MhZzgGm3bf+HnADOOimZ2Q++MXU=";
};
};
my-lspsaga = pkgs.vimUtils.buildVimPlugin {
name = "lspsaga.nvim";
src = pkgs.fetchFromGitHub {
@ -144,6 +134,9 @@ in
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 ];
programs.neovim = {
enable = true;
@ -495,6 +488,10 @@ in
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
-- private mode
-- Setup private mode
require('private-mode').setup({ keymap = '<leader>pm' })
local luasnip = require("luasnip")
local lspkind = require("lspkind")
local cmp = require('cmp')
@ -856,21 +853,6 @@ in
require("which-key").setup{}
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
local scnvim = require 'scnvim'
local map = scnvim.map
@ -1074,67 +1056,6 @@ in
}):find()
end
-- Setup amp.nvim
require('amp').setup({
auto_start = true,
log_level = "info"
})
-- Amp commands
vim.api.nvim_create_user_command("AmpSend", function(opts)
local message = opts.args
if message == "" then
print("Please provide a message to send")
return
end
local amp_message = require("amp.message")
amp_message.send_message(message)
end, {
nargs = "*",
desc = "Send a message to Amp",
})
vim.api.nvim_create_user_command("AmpSendBuffer", function(opts)
local buf = vim.api.nvim_get_current_buf()
local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false)
local content = table.concat(lines, "\n")
local amp_message = require("amp.message")
amp_message.send_message(content)
end, {
nargs = "?",
desc = "Send current buffer contents to Amp",
})
vim.api.nvim_create_user_command("AmpPromptSelection", function(opts)
local lines = vim.api.nvim_buf_get_lines(0, opts.line1 - 1, opts.line2, false)
local text = table.concat(lines, "\n")
local amp_message = require("amp.message")
amp_message.send_to_prompt(text)
end, {
range = true,
desc = "Add selected text to Amp prompt",
})
vim.api.nvim_create_user_command("AmpPromptRef", function(opts)
local bufname = vim.api.nvim_buf_get_name(0)
if bufname == "" then
print("Current buffer has no filename")
return
end
local relative_path = vim.fn.fnamemodify(bufname, ":.")
local ref = "@" .. relative_path
if opts.line1 ~= opts.line2 then
ref = ref .. "#L" .. opts.line1 .. "-" .. opts.line2
elseif opts.line1 > 1 then
ref = ref .. "#L" .. opts.line1
end
local amp_message = require("amp.message")
amp_message.send_to_prompt(ref)
end, {
range = true,
desc = "Add file reference (with selection) to Amp prompt",
})
EOF
'';
@ -1253,7 +1174,6 @@ in
# custom
yuck-vim
nvim-parinfer
amp-nvim
# vim-processing
] ++ lib.optionals pkgs.stdenv.isLinux [
# Linux-only plugins

View file

@ -0,0 +1,95 @@
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

@ -57,6 +57,15 @@
# seafile
};
# for vibe code stuff, over wireguard
networking.firewall = {
allowedTCPPorts = [ 22 3000 4173 ]; # allow ssh, vibe, and vibekanban
allowedTCPPortRanges = [{
from = 6666;
to = 7666;
}];
};
environment.systemPackages = with pkgs; [ lm_sensors ];
hardware.fancontrol = {
enable = false;

View file

@ -8,7 +8,7 @@
# ../profiles/music
../profiles/sync/cal
../profiles/wifi
../profiles/desktop
# ../profiles/desktop # Disabled: conflicts with jovian desktop manager
../profiles/mimetypes
../profiles/syncthing
../profiles/mossnet-hosts
@ -31,12 +31,11 @@
# theme = "motion";
# };
# jovian.steam.enable = true;
# jovian.devices.steamdeck.enable = true;
# jovian.steam.user = "anish";
# jovian.steam.autoStart = true;
# jovian.steam.desktopSession = "gnome";
# jovian.steam.desktopSession = "none+bspwm";
jovian.steam.enable = true;
jovian.devices.steamdeck.enable = true;
jovian.steam.user = "anish";
jovian.steam.autoStart = true;
jovian.steam.desktopSession = "gamescope-wayland";
# Disable lightdm from desktop profile
services.xserver.displayManager.lightdm.enable = lib.mkForce false;

View file

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

View file

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

View file

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

View file

@ -50,5 +50,40 @@ 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";
};
};
};
}