refactor: massive refactor using flake-parts; use typos-cli and

keep-sorted
This commit is contained in:
2025-12-20 12:57:47 +08:00
parent d5f027f586
commit bc197eb3ca
21 changed files with 466 additions and 455 deletions

View File

@@ -16,7 +16,6 @@ lib.my.makeSwitch {
environment.systemPackages = with pkgs; [
vim
wget
git
file
gnused
@@ -39,8 +38,6 @@ lib.my.makeSwitch {
dnsutils
killall
comma
];
programs.dconf.enable = true;
@@ -51,16 +48,20 @@ lib.my.makeSwitch {
];
my.hm = {
home.packages = with pkgs; [
lsd
fd
neofetch
fastfetch
fzf
bat
ripgrep
# keep-sorted start
aria2
bat
comma
fastfetch
fd
fzf
keep-sorted
lsd
neofetch
ripgrep
socat
typos
# keep-sorted end
];
programs.tmux = {
enable = true;

View File

@@ -18,7 +18,7 @@ theme[main_fg]="#D8DEE9"
# Title color for boxes
theme[title]="#8FBCBB"
# Higlight color for keyboard shortcuts
# Highlight color for keyboard shortcuts
theme[hi_fg]="#5E81AC"
# Background color of selected item in processes box

View File

@@ -22,6 +22,7 @@ lib.my.makeSwitch {
url = "https://raw.githubusercontent.com/folke/tokyonight.nvim/refs/tags/v4.14.1/extras/fish_themes/tokyonight_storm.theme";
sha256 = "02n1w5x65683c8mlwg1rav06iqm3xk90zq45qmygpm7pzyn8dqh1";
};
programs.starship.enableFishIntegration = false;
programs.fish = {
enable = true;
plugins = [
@@ -34,6 +35,15 @@ lib.my.makeSwitch {
hash = "sha256-yef5NX4HdZ3ab/2AzNrvvhi0CbeTvXYKZmyH76gIpyk=";
};
}
{
name = "starship";
src = pkgs.fetchFromGitHub {
owner = "tyler-stefani";
repo = "starship";
rev = "fff9bc53ef9997775d31d860246af88cd7721ec8";
hash = "sha256-S/Vt/jfYTCrMXXfu6YUIv+d0RoT7GYG1isayhtHc7DA=";
};
}
];
shellAliases = {
la = "lsd -lah";

View File

@@ -29,6 +29,8 @@ lib.my.makeHomeProgramConfig {
gcc # treesitter
ripgrep # telescope
typos-lsp
];
};
};

View File

@@ -37,7 +37,7 @@ vim.g.autoread = true
vim.g.loaded_ruby_provider = 0
-- Hightlight on yank
-- Highlight on yank
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
@@ -55,12 +55,12 @@ vim.cmd([[
\ endif
]])
-- Automaticly switch input method
-- Automatically switch input method
Last_input_method = 1
vim.api.nvim_create_augroup("AutoInputMethod", {})
vim.api.nvim_create_autocmd("InsertLeave", {
pattern = "*",
desc = "Automaticly switch input method",
desc = "Automatically switch input method",
callback = function()
Last_input_method = require("core.globals").switch_input_method(1)
end,
@@ -68,7 +68,7 @@ vim.api.nvim_create_autocmd("InsertLeave", {
})
vim.api.nvim_create_autocmd("CmdlineLeave", {
pattern = "*",
desc = "Automaticly switch input method",
desc = "Automatically switch input method",
callback = function()
require("core.globals").switch_input_method(1)
end,
@@ -76,7 +76,7 @@ vim.api.nvim_create_autocmd("CmdlineLeave", {
})
vim.api.nvim_create_autocmd("InsertEnter", {
pattern = "*",
desc = "Automaticly switch input method",
desc = "Automatically switch input method",
callback = function()
require("core.globals").switch_input_method(Last_input_method)
end,

View File

@@ -42,7 +42,16 @@ local servers = {
command = { "nixfmt" },
},
nixpkgs = {
expr = "import <nixpkgs> { }",
expr = [[
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
nodeName = lock.nodes.root.inputs.nixpkgs;
in
import (fetchTarball {
url = lock.nodes.${nodeName}.locked.url or "https://github.com/NixOS/nixpkgs/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz";
sha256 = lock.nodes.${nodeName}.locked.narHash;
}) { }
]],
},
},
},
@@ -54,14 +63,17 @@ local servers = {
qmlls = {
cmd = { "qmlls", "-E" },
},
pyright = {},
gopls = {},
-- keep-sorted start
clangd = {},
ts_ls = {},
jsonls = {},
cssls = {},
gopls = {},
html = {},
java_language_server = {},
jsonls = {},
pyright = {},
ts_ls = {},
typos_lsp = {},
-- keep-sorted end
}
local capabilities = require("cmp_nvim_lsp").default_capabilities()

View File

@@ -25,7 +25,7 @@ lib.my.makeSwitch {
settings = {
globalOptions = {
"PreeditEnabledByDefault"."0" = true;
"Hotkey"."EnumrateWithTriggerKeys" = false;
"Hotkey"."EnumerateWithTriggerKeys" = false;
"Hotkey/TriggerKeys"."0" = "";
"Hotkey/AltTriggerKeys"."0" = "Shift_L";
"Hotkey/EnumerateForwardKeys"."0" = "";

View File

@@ -1,5 +1,6 @@
{
inputs,
self,
config,
lib,
pkgs,
@@ -16,7 +17,7 @@ lib.my.makeSwitch {
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
nix.registry = (lib.mapAttrs (_: flake: { inherit flake; })) (
(lib.filterAttrs (_: lib.isType "flake")) inputs
((lib.filterAttrs (_: lib.isType "flake")) inputs) // { flake = self; }
);
# This will additionally add your inputs to the system's legacy channels

View File

@@ -2,7 +2,7 @@
{
options = {
grabKeyboard = lib.mkOption {
description = "Grab the keybaord in capture mode";
description = "Grab the keyboard in capture mode";
default = true;
type = lib.types.bool;
};

View File

@@ -38,7 +38,7 @@
};
clipboardToLocal = lib.mkOption {
description = "Allow the clipbaord to be synchronized FROM the VM";
description = "Allow the clipboard to be synchronized FROM the VM";
default = true;
type = lib.types.bool;
};
@@ -56,7 +56,7 @@
};
captureOnStart = lib.mkOption {
description = "Capture mouse and keybaord on start";
description = "Capture mouse and keyboard on start";
default = false;
type = lib.types.bool;
};