Compare commits

..

1 Commits

Author SHA1 Message Date
dichgrem
8650ac8879 fix:switch.sh&&mysql 2025-12-04 18:47:47 +08:00
14 changed files with 318 additions and 102 deletions

282
flake.lock generated
View File

@@ -68,10 +68,33 @@
"type": "github"
}
},
"chaotic": {
"inputs": {
"flake-schemas": "flake-schemas",
"home-manager": "home-manager",
"jovian": "jovian",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1764720660,
"narHash": "sha256-zrU6DwLb5zXCg6JxfVJyNCJex0LjuTUXchotq44Vn+w=",
"owner": "chaotic-cx",
"repo": "nyx",
"rev": "1739cb8049b3184496279dc6a272b56d466ddd58",
"type": "github"
},
"original": {
"owner": "chaotic-cx",
"ref": "nyxpkgs-unstable",
"repo": "nyx",
"type": "github"
}
},
"daeuniverse": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1762203410,
@@ -94,11 +117,11 @@
]
},
"locked": {
"lastModified": 1765326679,
"narHash": "sha256-fTLX9kDwLr9Y0rH/nG+h1XG5UU+jBcy0PFYn5eneRX8=",
"lastModified": 1764627417,
"narHash": "sha256-D6xc3Rl8Ab6wucJWdvjNsGYGSxNjQHzRc2EZ6eeQ6l4=",
"owner": "nix-community",
"repo": "disko",
"rev": "d64e5cdca35b5fad7c504f615357a7afe6d9c49e",
"rev": "5a88a6eceb8fd732b983e72b732f6f4b8269bef3",
"type": "github"
},
"original": {
@@ -149,11 +172,11 @@
]
},
"locked": {
"lastModified": 1765495779,
"narHash": "sha256-MhA7wmo/7uogLxiewwRRmIax70g6q1U/YemqTGoFHlM=",
"lastModified": 1763759067,
"narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "5635c32d666a59ec9a55cab87e898889869f7b71",
"rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0",
"type": "github"
},
"original": {
@@ -183,6 +206,38 @@
"type": "github"
}
},
"flake-schemas": {
"locked": {
"lastModified": 1721999734,
"narHash": "sha256-G5CxYeJVm4lcEtaO87LKzOsVnWeTcHGKbKxNamNWgOw=",
"rev": "0a5c42297d870156d9c57d8f99e476b738dcd982",
"revCount": 75,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.5/0190ef2f-61e0-794b-ba14-e82f225e55e6/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.1.5.tar.gz"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"fromYaml": {
"flake": false,
"locked": {
@@ -221,15 +276,16 @@
"home-manager": {
"inputs": {
"nixpkgs": [
"chaotic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1765606130,
"narHash": "sha256-KOP4QnkiRwiD5KEOr6ceF67rfTP1OqPmCCft6xDC3k4=",
"lastModified": 1764636297,
"narHash": "sha256-S41K55kw+hWgDfgKmZ9/fMZ3F0BQDMvqFfE120fMHeE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d787ec69c3216ea33be1c0424fe65cb23aa8fb31",
"rev": "ff067cfc619fdf6f82d50344e7d19ff2323f0827",
"type": "github"
},
"original": {
@@ -238,13 +294,106 @@
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1764788330,
"narHash": "sha256-hE/gXK+Z0j654T0tsW+KcndRqsgZXe8HyWchjBJgQpw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "fca4cba863e76c26cfe48e5903c2ff4bac2b2d5d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"ixx": {
"inputs": {
"flake-utils": [
"nixvim",
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nixvim",
"nuschtosSearch",
"nixpkgs"
]
},
"locked": {
"lastModified": 1754860581,
"narHash": "sha256-EM0IE63OHxXCOpDHXaTyHIOk2cNvMCGPqLt/IdtVxgk=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "babfe85a876162c4acc9ab6fb4483df88fa1f281",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.1.1",
"repo": "ixx",
"type": "github"
}
},
"jovian": {
"inputs": {
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"chaotic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1764655750,
"narHash": "sha256-tBrcUSu/47u+E+81SUVUpXrqhkcM3Xqg/4taWFI/99k=",
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"rev": "1127a4fc66425cceae683becb93f038819cf2633",
"type": "github"
},
"original": {
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"chaotic",
"jovian",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729697500,
"narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=",
"owner": "zhaofengli",
"repo": "nix-github-actions",
"rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"ref": "matrix-name",
"repo": "nix-github-actions",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1739866667,
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
"lastModified": 1764517877,
"narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
"rev": "2d293cbfa5a793b4c50d17c05ef9e385b90edf6c",
"type": "github"
},
"original": {
@@ -268,11 +417,27 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1765472234,
"narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=",
"lastModified": 1739866667,
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1764667669,
"narHash": "sha256-7WUCZfmqLAssbDqwg9cUDAXrSoXN79eEEq17qhTNM/Y=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b",
"rev": "418468ac9527e799809c900eda37cbff999199b6",
"type": "github"
},
"original": {
@@ -282,7 +447,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1764517877,
"narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=",
@@ -304,14 +469,15 @@
"nixpkgs": [
"nixpkgs"
],
"systems": "systems"
"nuschtosSearch": "nuschtosSearch",
"systems": "systems_2"
},
"locked": {
"lastModified": 1765646394,
"narHash": "sha256-yqeB023/s/SOxhpm4SFKBDHagzn5L/KF7bCA10ZH/Q4=",
"lastModified": 1764803799,
"narHash": "sha256-94SMf4Uw5iSoX37ui6LAdcadCUHUDfrvggGay0uWkis=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "c97e8e34250c7fe5d4e0c3333a0ca4a9d28957d0",
"rev": "5d1c27e53c96e2c94e69f2e2d083ef147b3a3ccb",
"type": "github"
},
"original": {
@@ -345,16 +511,61 @@
"type": "github"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1761730856,
"narHash": "sha256-t1i5p/vSWwueZSC0Z2BImxx3BjoUDNKyC2mk24krcMY=",
"owner": "NuschtOS",
"repo": "search",
"rev": "e29de6db0cb3182e9aee75a3b1fd1919d995d85b",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"root": {
"inputs": {
"chaotic": "chaotic",
"daeuniverse": "daeuniverse",
"disko": "disko",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_2",
"home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_3",
"nixvim": "nixvim",
"stylix": "stylix"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"chaotic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1764643237,
"narHash": "sha256-6Ezx9DqVv5UZ7DBK9rcNwBuQUENFyWPS7M09I+FvNao=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "e66d6b924ac59e6c722f69332f6540ea57c69233",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"stylix": {
"inputs": {
"base16": "base16",
@@ -364,9 +575,9 @@
"firefox-gnome-theme": "firefox-gnome-theme",
"flake-parts": "flake-parts_3",
"gnome-shell": "gnome-shell",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"nur": "nur",
"systems": "systems_2",
"systems": "systems_3",
"tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes",
@@ -374,11 +585,11 @@
"tinted-zed": "tinted-zed"
},
"locked": {
"lastModified": 1765474444,
"narHash": "sha256-sDG+c73xEnIw1pFNRWffKDnTWiTuyZiEP+Iub0D3mWA=",
"lastModified": 1764798099,
"narHash": "sha256-IIwR5ZWo7tjxjRpkz0tViF9KFbQ1YXs9Wkan46WQbfk=",
"owner": "danth",
"repo": "stylix",
"rev": "dd14de4432a94e93e10d0159f1d411487e435e1e",
"rev": "4b9e0e7ba3cccb86fe2bf0f4a2dd18256bef1cc6",
"type": "github"
},
"original": {
@@ -417,6 +628,21 @@
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tinted-foot": {
"flake": false,
"locked": {

View File

@@ -2,7 +2,7 @@
description = "🥶";
inputs = {
# chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
daeuniverse.url = "github:daeuniverse/flake.nix";
disko.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";

View File

@@ -45,7 +45,6 @@
python312Packages.python-lsp-server
#JS/TS/Web
biome
prettierd
nodePackages.prettier
@@ -94,6 +93,7 @@
which-key-nvim
fzf-lua
snacks-nvim
markview-nvim
{
name = "lazydev.nvim";
path = lazydev-nvim;
@@ -223,6 +223,8 @@
yaml
toml
dockerfile
markdown
markdown_inline
])).dependencies;
};
in

View File

@@ -5,31 +5,40 @@
local map = vim.keymap.set
local opts = { noremap = true, silent = true }
-- === VSCode-like buffer/tab navigation ===
-- === VSCode-like buffer/tab navigation ===
map("n", "<C-Tab>", "<cmd>bnext<CR>", { desc = "Next buffer (like VSCode)" })
map("n", "<C-S-Tab>", "<cmd>bprevious<CR>", { desc = "Previous buffer (like VSCode)" })
-- === Vscode-like Close buffer navigation ===
vim.keymap.set("n", "<C-w>", function()
local current = vim.api.nvim_get_current_buf()
local buffers = vim.fn.getbufinfo({buflisted = 1})
-- === Close buffer like Ctrl + W in VSCode ===
vim.keymap.set("n", "<C-w>", "<cmd>BufferLinePickClose<CR>", { desc = "Close buffer (BufferLine)" })
local next_buf = nil
for i, buf in ipairs(buffers) do
if buf.bufnr == current then
next_buf = buffers[i + 1] or buffers[i - 1]
break
end
end
vim.keymap.set("n", "<C-S-5>", function()
if vim.bo.buftype == "terminal" then
vim.cmd("vsplit | terminal")
else
vim.cmd("botright split | terminal")
end
end, { desc = "Split terminal" })
if next_buf then
vim.api.nvim_set_current_buf(next_buf.bufnr)
end
-- 在终端模式下的快捷键
vim.keymap.set("t", "<C-h>", "<C-\\><C-n><C-w>h", { desc = "Go to left window" })
vim.keymap.set("t", "<C-j>", "<C-\\><C-n><C-w>j", { desc = "Go to lower window" })
vim.keymap.set("t", "<C-k>", "<C-\\><C-n><C-w>k", { desc = "Go to upper window" })
vim.keymap.set("t", "<C-l>", "<C-\\><C-n><C-w>l", { desc = "Go to right window" })
vim.api.nvim_buf_delete(current, { force = true })
end, { desc = "Close current buffer like VSCode" })
-- XDG Open
vim.keymap.set("n", "<leader>xo", function()
vim.fn.jobstart({ "xdg-open", vim.fn.expand("%:p") }, { detach = true })
end, { desc = "使用系统默认应用程序打开当前文件" })
-- === Markdown priview ===
vim.keymap.set("n", "<leader>mp", "<cmd>Markview<CR>", {
desc = "Toggle Markview Inline Preview",
})
-- 开启对比预览
vim.keymap.set("n", "<leader>mv", "<cmd>Markview splitToggle<CR>", {
desc = "Toggle Markview Split Preview",
})
-- 关闭对比预览
vim.keymap.set("n", "<leader>mc", "<cmd>Markview splitClose<CR>", {
desc = "Close Markview Split Preview",
})

View File

@@ -1,16 +1,4 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
-- Disable autoformat
vim.g.autoformat = false
-- Let terminal just one
vim.g.root_spec = { "cwd" }
-- Disable markdown views
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function()
vim.opt_local.conceallevel = 0
vim.opt_local.concealcursor = ""
end,
})
vim.g.autoformat = false

View File

@@ -1,28 +0,0 @@
return {
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
config = function()
require("copilot").setup({
suggestion = { enabled = true, auto_trigger = true },
})
end,
},
{
"CopilotC-Nvim/CopilotChat.nvim",
branch = "main",
dependencies = {
{ "zbirenbaum/copilot.lua" },
{ "nvim-lua/plenary.nvim" },
},
opts = {
debug = false,
},
keys = {
{ "<leader>cc", "<cmd>CopilotChatToggle<cr>", desc = "CopilotChat - Toggle" },
{ "<leader>ce", "<cmd>CopilotChatExplain<cr>", mode = "v", desc = "CopilotChat - Explain code" },
},
},
}

View File

@@ -34,11 +34,11 @@ return {
-- Python
opts.formatters_by_ft.python = { "black", "ruff_format" }
-- JS/TS/Web
opts.formatters_by_ft.javascript = { "biome" }
opts.formatters_by_ft.typescript = { "biome" }
opts.formatters_by_ft.javascriptreact = { "biome" }
opts.formatters_by_ft.typescriptreact = { "biome" }
opts.formatters_by_ft.vue = { "biome" }
opts.formatters_by_ft.javascript = { "prettierd" }
opts.formatters_by_ft.typescript = { "prettierd" }
opts.formatters_by_ft.javascriptreact = { "prettierd" }
opts.formatters_by_ft.typescriptreact = { "prettierd" }
opts.formatters_by_ft.vue = { "prettierd" }
-- JSON
opts.formatters_by_ft.json = { "jq" }
-- YAML

View File

@@ -0,0 +1,19 @@
return {
"OXY2DEV/markview.nvim",
name = "markview.nvim",
lazy = false,
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
config = function()
require("markview").setup({
markdown = { enable = true },
latex = {
enable = true,
inline = { enable = true },
block = { enable = true },
},
})
end,
}

View File

@@ -6,7 +6,7 @@
}: {
imports = with inputs; [
./${hostname}
# chaotic.nixosModules.default
chaotic.nixosModules.default
disko.nixosModules.disko
stylix.nixosModules.stylix
home-manager.nixosModules.home-manager

View File

@@ -23,7 +23,7 @@
BootLoader = "systemd-boot";
### Possible options: grub ; grub-mirror ; systemd-boot # See https://nixos.wiki/wiki/Bootloader https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=mirroredBoots
KernelPackages = "linuxPackages_zen";
KernelPackages = "linuxPackages_cachyos";
### See https://search.nixos.org/options?show=boot.kernelPackages https://www.nyx.chaotic.cx/#using-sched-ext-schedulers
KeyboardLayout = "us";

View File

@@ -32,7 +32,7 @@
BootLoader = "systemd-boot";
### Possible options: grub ; grub-mirror ; systemd-boot # See https://nixos.wiki/wiki/Bootloader https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=mirroredBoots
KernelPackages = "linuxPackages_zen";
KernelPackages = "linuxPackages_cachyos";
### See https://search.nixos.org/options?show=boot.kernelPackages https://www.nyx.chaotic.cx/#using-sched-ext-schedulers
KeyboardLayout = "us";

View File

@@ -10,7 +10,7 @@ in
};
systemd.services.mysql = {
wantedBy = lib.mkForce [ ];
enable = false;
};
environment.systemPackages = [

View File

@@ -90,7 +90,7 @@ in {
jdk17
python312
pnpm
nodejs_24
nodejs_20
];
};

View File

@@ -31,13 +31,13 @@ with lib; {
substituters = [
"https://cache.garnix.io" # See https://github.com/daeuniverse/flake.nix
"https://cache.nixos.org" # See https://nixos.wiki/wiki/Binary_Cache
# "https://chaotic-nyx.cachix.org" # See https://github.com/chaotic-cx/nyx
"https://chaotic-nyx.cachix.org" # See https://github.com/chaotic-cx/nyx
"https://nix-community.cachix.org" # See https://nix-community.org/cache/
];
trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
# "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
warn-dirty = false;