feat: add outbound firewall to server & add helix and zellij

This commit is contained in:
danny 2025-10-22 16:24:33 +08:00
parent d273765b99
commit 7fcf26263a
23 changed files with 769 additions and 145 deletions

View file

@ -1,4 +1,5 @@
{
osConfig,
pkgs,
lib,
inputs,
@ -27,6 +28,7 @@ in
imports = [
./plugins/snacks-nvim
./plugins/lualine
./extra-lsp.nix
];
programs.nvf = {
@ -35,6 +37,7 @@ in
vim = {
enableLuaLoader = true;
vimAlias = true;
extraPackages = with pkgs; [ nixfmt ];
clipboard = {
enable = true;
@ -236,6 +239,7 @@ in
nowait = true;
desc = "Select terminal";
}
# Send current selection to Term
{
key = "<Leader>ts";
@ -316,9 +320,13 @@ in
lsp = {
enable = true;
formatOnSave = true;
otter-nvim.enable = true;
otter-nvim = {
enable = true;
setupOpts.handle_leading_whitespace = true;
};
nvim-docs-view.enable = true;
lspkind.enable = true;
null-ls.enable = false;
trouble = {
enable = true;
mappings = {
@ -334,6 +342,15 @@ in
};
};
formatter = {
conform-nvim = {
enable = true;
setupOpts.formatters_by_ft = {
nix = [ "nixfmt" ];
};
};
};
diagnostics = {
enable = true;
config = {
@ -358,6 +375,7 @@ in
bash.enable = true;
css.enable = true;
yaml.enable = true;
rust = {
enable = true;
lsp = {
@ -379,20 +397,17 @@ in
nix = {
enable = true;
extraDiagnostics.enable = false;
format.type = "nixfmt";
format.enable = false; # Manually configured in conform-nvim
lsp = {
server = "nil";
server = "nixd";
options = {
nix.flake.autoArchive = true;
nixos.expr =
# nix
''(builtins.getFlake "/etc/nixos").nixosConfigurations.${osConfig.networking.hostName}.options'';
home_manager.expr =
# nix
''(builtins.getFlake "/etc/nixos").nixosConfigurations.${osConfig.networking.hostName}.options.home-manager.users.type.getSubOptions []'';
};
# options = {
# nixos.expr =
# # nix
# ''(builtins.getFlake (builtins.toString ./.)).nixosConfigurations.${osConfig.networking.hostName}.options'';
# home_manager.expr =
# # nix
# ''(builtins.getFlake (builtins.toString ./.)).nixosConfigurations.${osConfig.networking.hostName}.options.home-manager.users.type.getSubOptions []'';
# };
};
};
sql.enable = true;
@ -513,6 +528,7 @@ in
yazi-nvim = {
enable = true;
mappings.openYaziDir = "<leader>e";
};
images = {

View file

@ -0,0 +1,22 @@
{ pkgs, ... }:
{
programs.nvf.settings.vim = {
diagnostics.nvim-lint.linters_by_ft = {
dockerfile = [ "hadolint" ];
};
treesitter.grammars = with pkgs.vimPlugins.nvim-treesitter-parsers; [
dockerfile
];
extraPackages = with pkgs; [
# docker
hadolint
dockerfile-language-server
docker-compose-language-service
];
lsp.servers = {
dockerls = { };
docker_compose_language_service = { };
};
};
}

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ lib, ... }:
{
programs.nvf.settings.vim.statusline = {
lualine = {
@ -48,22 +48,24 @@
''
];
c = lib.mkForce [
# lua
''
{
"diff",
colored = false,
diff_color = {
-- Same color values as the general color option can be used here.
added = 'DiffAdd', -- Changes the diff's added color
modified = 'DiffChange', -- Changes the diff's modified color
removed = 'DiffDelete', -- Changes the diff's removed color you
},
symbols = {added = '+', modified = '~', removed = '-'}, -- Changes the diff symbols
separator = {right = ''}
}
{
"diff",
colored = false,
diff_color = {
-- Same color values as the general color option can be used here.
added = 'DiffAdd', -- Changes the diff's added color
modified = 'DiffChange', -- Changes the diff's modified color
removed = 'DiffDelete', -- Changes the diff's removed color you
},
symbols = {added = '+', modified = '~', removed = '-'}, -- Changes the diff symbols
separator = {right = ''}
}
''
];
x = lib.mkForce [
# lua
''
{
-- Lsp server name
@ -93,6 +95,18 @@
separator = {left = ''},
}
''
# lua
''
{
-- Recording Status
function()
local reg = vim.fn.reg_recording()
if reg == "" then return "" end
return "@" .. reg
end,
}
''
# lua
''
{
"diagnostics",

View file

@ -70,7 +70,7 @@ in
enabled = false;
};
explorer = {
enabled = true;
enabled = false;
};
indent = {
enabled = true;

View file

@ -1,10 +1,5 @@
let
keyList = [
{
key = "<leader>e";
action = "explorer()";
desc = "Toggle explorer";
}
{
key = "<leader><space>";
action = "picker.smart()";