idk a bunch more updates

This commit is contained in:
Anish Lakhwara 2025-11-21 21:06:42 -08:00
parent baa309eb4b
commit 6edf5ecdfc
11 changed files with 182 additions and 34 deletions

View file

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

View file

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

View file

@ -31,7 +31,7 @@
bat bat
fd fd
ncdu ncdu
du-dust dust
# dia-cli # dia-cli
duf duf
trash-cli trash-cli
@ -63,6 +63,7 @@
taskwarrior-tui taskwarrior-tui
# vimwiki-cli # vimwiki-cli
zk zk
unstable.opencode
(pkgs.writeScriptBin "jq-repl" '' (pkgs.writeScriptBin "jq-repl" ''
#!/usr/bin/env bash #!/usr/bin/env bash

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, config, ... }:
let let
customPlugins = { customPlugins = {
vim-zettel = pkgs.vimUtils.buildVimPlugin { vim-zettel = pkgs.vimUtils.buildVimPlugin {
@ -139,6 +139,9 @@ 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;
@ -482,6 +485,10 @@ 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')
@ -1206,7 +1213,7 @@ in
owner = "sourcegraph"; owner = "sourcegraph";
repo = "amp.nvim"; repo = "amp.nvim";
rev = "main"; rev = "main";
sha256 = "1n6d8nbakyg6yiq8mhhrvmsp9z0zb8cb67820jsg3wl6vqd1vwv5"; sha256 = "sha256-+jIbAZjRpt30gcrIiwW+yZhT9CFLnW9ARf92GEfioZ0=";
}; };
}) })
]; ];

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 # 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 ]; environment.systemPackages = with pkgs; [ lm_sensors ];
hardware.fancontrol = { hardware.fancontrol = {
enable = false; enable = false;

View file

@ -8,7 +8,7 @@
# ../profiles/music # ../profiles/music
../profiles/sync/cal ../profiles/sync/cal
../profiles/wifi ../profiles/wifi
../profiles/desktop # ../profiles/desktop # Disabled: conflicts with jovian desktop manager
../profiles/mimetypes ../profiles/mimetypes
../profiles/syncthing ../profiles/syncthing
../profiles/mossnet-hosts ../profiles/mossnet-hosts
@ -35,8 +35,7 @@
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 = "gnome"; jovian.steam.desktopSession = "gamescope-wayland";
# jovian.steam.desktopSession = "none+bspwm";
# Install XR drivers # Install XR drivers
# environment.systemPackages = with pkgs; [ # environment.systemPackages = with pkgs; [

View file

@ -57,7 +57,6 @@ 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
@ -67,7 +66,6 @@ in {
unstable.liferea unstable.liferea
unstable.gh unstable.gh
unstable.flyctl unstable.flyctl
unstable.sublime-music
kooha kooha
light light

View file

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

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,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) /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";
};
};
}; };
} }