Compare commits

...

4 commits

Author SHA1 Message Date
877cabbb42 dot(pw): mic name
Some checks failed
Shell Script Check & Format / shell-check (push) Has been cancelled
2026-03-15 21:49:09 +00:00
f740b78081 dot(niri): wpctl with notification 2026-03-15 21:43:13 +00:00
1b5c26bc04 chore: reorg 2026-03-15 21:07:36 +00:00
e0a023da4f chore: remove dups 2026-03-09 23:22:42 +00:00
67 changed files with 610 additions and 362 deletions

View file

@ -57,43 +57,4 @@ if vim.g.neovide then
vim.g.neovide_input_macos_option_key_is_meta = "only_left" vim.g.neovide_input_macos_option_key_is_meta = "only_left"
end end
-- TODO: Refractor this part to submodules require("config.fcitx")
-- 存储输入法状态的变量
vim.g.input_layout = nil
-- 退出插入模式时:记录当前输入法并切换到英文
local function fcitx2en()
-- 使用 fcitx5-remote -n 获取当前输入法名称
local current_layout = vim.fn.system("fcitx5-remote -n")
-- 去除换行符
vim.g.input_layout = vim.trim(current_layout)
-- 切换到英文输入法
vim.fn.system("fcitx5-remote -s keyboard-us")
end
-- 进入插入模式时:恢复之前的输入法状态
local function fcitx2zh()
-- 如果之前记录了输入法状态,则恢复
if vim.g.input_layout ~= nil and vim.g.input_layout ~= "" then
vim.fn.system("fcitx5-remote -s " .. vim.g.input_layout)
end
end
-- 设置 ttimeoutlen
vim.opt.ttimeoutlen = 150
-- 创建自动命令组
local fcitx_group = vim.api.nvim_create_augroup("FcitxToggle", { clear = true })
-- 退出插入模式时切换到英文并记录状态
vim.api.nvim_create_autocmd("InsertLeave", {
group = fcitx_group,
callback = fcitx2en,
})
-- 进入插入模式时恢复之前的输入法
vim.api.nvim_create_autocmd("InsertEnter", {
group = fcitx_group,
callback = fcitx2zh,
})

View file

@ -1,7 +1,7 @@
-- This file *currently* contains the colorscheme for lualine (status line) -- This file *currently* contains the colorscheme for lualine (status line)
local M = {} local M = {}
-- TODO: Change the palatte when the colorscheme changes -- NOTE: Currently only handles catppuccin latte/mocha palettes
if vim.g.colors_name == "catppuccin-latte" then if vim.g.colors_name == "catppuccin-latte" then
M.scheme = require("catppuccin.palettes.latte") M.scheme = require("catppuccin.palettes.latte")

View file

@ -0,0 +1,27 @@
vim.g.input_layout = nil
local function fcitx2en()
local current_layout = vim.fn.system("fcitx5-remote -n")
vim.g.input_layout = vim.trim(current_layout)
vim.fn.system("fcitx5-remote -s keyboard-us")
end
local function fcitx2zh()
if vim.g.input_layout ~= nil and vim.g.input_layout ~= "" then
vim.fn.system("fcitx5-remote -s " .. vim.g.input_layout)
end
end
vim.opt.ttimeoutlen = 150
local fcitx_group = vim.api.nvim_create_augroup("FcitxToggle", { clear = true })
vim.api.nvim_create_autocmd("InsertLeave", {
group = fcitx_group,
callback = fcitx2en,
})
vim.api.nvim_create_autocmd("InsertEnter", {
group = fcitx_group,
callback = fcitx2zh,
})

View file

@ -1,4 +1,3 @@
-- TODO:
-- Debugger setups -- Debugger setups
return { return {
{ {

View file

@ -115,7 +115,6 @@ M.progress = {
"progress", "progress",
} }
-- TODO: Implement orgmode
M.orgmode = { M.orgmode = {
function() function()
return _G.orgmode.statusline() return _G.orgmode.statusline()

191
nixcfgs/flake.lock generated
View file

@ -100,11 +100,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1771987897, "lastModified": 1772764582,
"narHash": "sha256-5pNQFGxG3fxS9pGnNBJjT76veotKIKq2XpAVFGAhCdI=", "narHash": "sha256-hSwjmpXHFqzSXrndVekA0IheKrbC7wi0IbfZTYwlmXw=",
"owner": "caelestia-dots", "owner": "caelestia-dots",
"repo": "cli", "repo": "cli",
"rev": "b0d68f0a1c48fa138d6fde94dcbecea801a86a01", "rev": "4bcd42f482d038b98145b0b03388244b68b7d35d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -122,11 +122,11 @@
"quickshell": "quickshell" "quickshell": "quickshell"
}, },
"locked": { "locked": {
"lastModified": 1772330657, "lastModified": 1773574600,
"narHash": "sha256-cWblprYsDUeAWA57xAqxIjNxXvDI/rqYn6TFp2OPi/k=", "narHash": "sha256-RsBgiq93SjlYVHSYtz/ESALa7WgbLu+xcH0oTJRjztQ=",
"owner": "caelestia-dots", "owner": "caelestia-dots",
"repo": "shell", "repo": "shell",
"rev": "278fd4a4ed1bfb42c3fe197ff38b587539c012aa", "rev": "377778596acf90451d1bd19f0c03b5f1c0467958",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -140,11 +140,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1772153824, "lastModified": 1773403535,
"narHash": "sha256-T65qXmlcD9qFpPTi+mOXsn4dIkO2N8Ls67nqmuzepv0=", "narHash": "sha256-47MZaFrHxNO8tVUAmtVnerXUw2WWVluBOiU9MulN/yM=",
"owner": "catppuccin", "owner": "catppuccin",
"repo": "nix", "repo": "nix",
"rev": "4b0f5b7bf7b3eeb484d49524f3c9791864ab9362", "rev": "d45b5665cc638bad1b794350de02f4dd41b0bb47",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -174,11 +174,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1770910218, "lastModified": 1773079031,
"narHash": "sha256-IyHoHbhLFuIgFG+n7dqHwJaXuNnRaEsxCfAsfudV1KY=", "narHash": "sha256-RvCzINnVISBT3d0F1DoIcQFbQsbRJISW9qZeKTzmNaA=",
"owner": "abenz1267", "owner": "abenz1267",
"repo": "elephant", "repo": "elephant",
"rev": "c354a596ec7a7e34e9c26478dc7ef9680bc23e6d", "rev": "53afe39cef252010f7c55bd33c5bae6dd50dcf0c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -195,11 +195,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1772672954, "lastModified": 1773537505,
"narHash": "sha256-OGEqiNZnLjQd0R2Ei+0QW9Y+t2MZy8vAOS8caNiQxbw=", "narHash": "sha256-MsOpMvnnUjYPAtyApi93HcoHD91pAiCXHrjOCG3F7zY=",
"owner": "petrkozorezov", "owner": "petrkozorezov",
"repo": "firefox-addons-nix", "repo": "firefox-addons-nix",
"rev": "8c947cfbce2f6a769c0fcb736fd2eb14ff83b64b", "rev": "4e6bf49ad4fb8c9ddbb1b4fe2ef63b1b4ab4609a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -285,11 +285,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1765835352, "lastModified": 1772408722,
"narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=", "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "a34fae9c08a15ad73f295041fec82323541400a9", "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -440,11 +440,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1765774562, "lastModified": 1771131391,
"narHash": "sha256-UQhfCggNGDc7eam+EittlYmeW89CZVT1KkFIHZWBH7k=", "narHash": "sha256-HPBNYf7HiKtBVy7/69vKpLYHX6wTcUxndxmybzDlXP8=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "hercules-ci-effects", "repo": "hercules-ci-effects",
"rev": "edcbb19948b6caf1700434e369fde6ff9e6a3c93", "rev": "0b152e0f7c5cc265a529cd63374b80e2771b207b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -460,11 +460,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1772633327, "lastModified": 1773608492,
"narHash": "sha256-jl+DJB2DUx7EbWLRng+6HNWW/1/VQOnf0NsQB4PlA7I=", "narHash": "sha256-QZteyExJYSQzgxqdsesDPbQgjctGG7iKV/6ooyQPITk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "5a75730e6f21ee624cbf86f4915c6e7489c74acc", "rev": "9a40ec3b78fc688d0908485887d355caa5666d18",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -498,11 +498,11 @@
"xwayland-satellite-unstable": "xwayland-satellite-unstable" "xwayland-satellite-unstable": "xwayland-satellite-unstable"
}, },
"locked": { "locked": {
"lastModified": 1772698812, "lastModified": 1773577199,
"narHash": "sha256-7+K/VaZ7TXUeUGSYshg8wC3UsRZHB+M4x6r38Q1B79c=", "narHash": "sha256-Z77lGBRlueA+igtScByJ0soMRnEy5T/XG9w661OCPaw=",
"owner": "sodiboo", "owner": "sodiboo",
"repo": "niri-flake", "repo": "niri-flake",
"rev": "5641625ef950f024e3e0e3f38bb91f876290c0be", "rev": "afc45f69929e5b5ab23d903b24532cfe718de6be",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -531,11 +531,11 @@
"niri-unstable": { "niri-unstable": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1772207631, "lastModified": 1773130184,
"narHash": "sha256-Jkkg+KqshFO3CbTszVVpkKN2AOObYz+wMsM3ONo1z5g=", "narHash": "sha256-3bwx4WqCB06yfQIGB+OgIckOkEDyKxiTD5pOo4Xz2rI=",
"owner": "YaLTeR", "owner": "YaLTeR",
"repo": "niri", "repo": "niri",
"rev": "e708f546153f74acf33eb183b3b2992587a701e5", "rev": "b07bde3ee82dd73115e6b949e4f3f63695da35ea",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -551,11 +551,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1772379624, "lastModified": 1773000227,
"narHash": "sha256-NG9LLTWlz4YiaTAiRGChbrzbVxBfX+Auq4Ab/SWmk4A=", "narHash": "sha256-zm3ftUQw0MPumYi91HovoGhgyZBlM4o3Zy0LhPNwzXE=",
"owner": "nix-darwin", "owner": "nix-darwin",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "52d061516108769656a8bd9c6e811c677ec5b462", "rev": "da529ac9e46f25ed5616fd634079a5f3c579135f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -587,11 +587,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1772341813, "lastModified": 1773552174,
"narHash": "sha256-/PQ0ubBCMj/MVCWEI/XMStn55a8dIKsvztj4ZVLvUrQ=", "narHash": "sha256-mHSRNrT1rjeYBgkAlj07dW3+1nFEgAd8Gu6lgyfT9DU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "a2051ff239ce2e8a0148fa7a152903d9a78e854f", "rev": "8faeb68130df077450451b6734a221ba0d6cde42",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -612,11 +612,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1773046894, "lastModified": 1773607491,
"narHash": "sha256-Hf5Q6gkaSXojSu9neW0dxvefUc3aA2T8ZQLTdGKIGOU=", "narHash": "sha256-EQ4R6eSwnlpVjRrcfnIPlenCrnumkKU5mA0MkzkYaMo=",
"owner": "openclaw", "owner": "openclaw",
"repo": "nix-openclaw", "repo": "nix-openclaw",
"rev": "b39fc7f507097858273bda50834c6ab7367d7b09", "rev": "4136401fbfbed632df86825dfdd4bac2f8d2b285",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -630,11 +630,11 @@
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1773038583, "lastModified": 1773561580,
"narHash": "sha256-E9Z/7U2ozB7nvCUZp9QlWllFl1yNXaInnuBSiRV5qh4=", "narHash": "sha256-wT0bKTp45YnMkc4yXQvk943Zz/rksYiIjEXGdWzxnic=",
"owner": "openclaw", "owner": "openclaw",
"repo": "nix-steipete-tools", "repo": "nix-steipete-tools",
"rev": "561592b0b1aa9b53595618fd867be633a192da54", "rev": "cd4c429ff3b3aaef9f92e59812cf2baf5704b86f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -647,14 +647,15 @@
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_6",
"nixpkgs-nixcord": "nixpkgs-nixcord"
}, },
"locked": { "locked": {
"lastModified": 1772671545, "lastModified": 1773597570,
"narHash": "sha256-7CFg6ppK000u+bd87+6HSVkFSC8PKm/N22MMZMtYla4=", "narHash": "sha256-A6KsirR9kxR1wVFTr8aagk5vUT3rvKTf79Qht6YkxUA=",
"owner": "kaylorben", "owner": "kaylorben",
"repo": "nixcord", "repo": "nixcord",
"rev": "9c048e21aa13ab529f00ab1f13c3793ba0b49b7c", "rev": "1cc0ddb766e459b7187e6aeb8b2e046d37361dc4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -672,11 +673,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1769288622, "lastModified": 1773434720,
"narHash": "sha256-GaDPnzDQAx5WRi12XVttCHsVw0VkOMYNpniT7KHYNfk=", "narHash": "sha256-mK4yEIF+qF7qtAzC5x8GU8kh5lY4v397azT+m1nBvRQ=",
"owner": "nixpak", "owner": "nixpak",
"repo": "nixpak", "repo": "nixpak",
"rev": "4276954ad4f877d79801fd8952af38a3370bcb65", "rev": "1bf4e77b07ce445779894f17ab21016db5f58a4e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -731,13 +732,29 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable": { "nixpkgs-nixcord": {
"locked": { "locked": {
"lastModified": 1772598333, "lastModified": 1773222311,
"narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=", "narHash": "sha256-BHoB/XpbqoZkVYZCfXJXfkR+GXFqwb/4zbWnOr2cRcU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239", "rev": "0590cd39f728e129122770c029970378a79d076a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1773524153,
"narHash": "sha256-Jms57zzlFf64ayKzzBWSE2SGvJmK+NGt8Gli71d9kmY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e9f278faa1d0c2fc835bd331d4666b59b505a410",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -797,11 +814,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1771848320, "lastModified": 1773122722,
"narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", "narHash": "sha256-FIqHByVqxCprNjor1NqF80F2QQoiiyqanNNefdlvOg4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2fc6539b481e1d2569f25f8799236694180c0993", "rev": "62dc67aa6a52b4364dd75994ec00b51fbf474e50",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -829,11 +846,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1772624091, "lastModified": 1773389992,
"narHash": "sha256-QKyJ0QGWBn6r0invrMAK8dmJoBYWoOWy7lN+UHzW1jc=", "narHash": "sha256-wvfdLLWJ2I9oEpDd9PfMA8osfIZicoQ5MT1jIwNs9Tk=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "80bdc1e5ce51f56b19791b52b2901187931f5353", "rev": "c06b4ae3d6599a672a6210b7021d699c351eebda",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -861,11 +878,11 @@
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1772465433, "lastModified": 1773222311,
"narHash": "sha256-ywy9troNEfpgh0Ee+zaV1UTgU8kYBVKtvPSxh6clYGU=", "narHash": "sha256-BHoB/XpbqoZkVYZCfXJXfkR+GXFqwb/4zbWnOr2cRcU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c581273b8d5bdf1c6ce7e0a54da9841e6a763913", "rev": "0590cd39f728e129122770c029970378a79d076a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -877,11 +894,11 @@
}, },
"nixpkgs_7": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1772674223, "lastModified": 1773507054,
"narHash": "sha256-/suKbHSaSmuC9UY7G0VRQ3aO+QKqxAQPQ19wG7QNkF8=", "narHash": "sha256-Q8U5VXgrcxmCxPtCCJCIZkcAX3FCZwGh1GNVIXxMND0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "66d9241e3dc2296726dc522e62dbfe89c7b449f3", "rev": "e80236013dc8b77aa49ca90e7a12d86f5d8d64c9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -893,11 +910,11 @@
}, },
"nixpkgs_8": { "nixpkgs_8": {
"locked": { "locked": {
"lastModified": 1772624091, "lastModified": 1773389992,
"narHash": "sha256-QKyJ0QGWBn6r0invrMAK8dmJoBYWoOWy7lN+UHzW1jc=", "narHash": "sha256-wvfdLLWJ2I9oEpDd9PfMA8osfIZicoQ5MT1jIwNs9Tk=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "80bdc1e5ce51f56b19791b52b2901187931f5353", "rev": "c06b4ae3d6599a672a6210b7021d699c351eebda",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -929,11 +946,11 @@
"nixpkgs": "nixpkgs_8" "nixpkgs": "nixpkgs_8"
}, },
"locked": { "locked": {
"lastModified": 1772725591, "lastModified": 1773608735,
"narHash": "sha256-I5WiAHsTkgUNOEtNvysNC7zVt4VNV0Ve3qsuiTQ9RiI=", "narHash": "sha256-dqaylgm5x/cjyqo/V1kAsiyQQ5S6/Kc8QGBAUem9nlg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "3567b1d67fc040f0a9206b1824069b68fe172f05", "rev": "21d9c792956edffe574411dcf08ea1429175e07a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -998,11 +1015,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1771926182, "lastModified": 1772925576,
"narHash": "sha256-QbXuSLhiSxOq6ydBL3+KGe1aiYWBW+e3J6qjJZaRMq0=", "narHash": "sha256-mMoiXABDtkSJxCYDrkhJ/TrrJf5M46oUfIlJvv2gkZ0=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "cddb4f061bab495f4473ca5f2c571b6c710efef7", "rev": "15a84097653593dd15fad59a56befc2b7bdc270d",
"revCount": 744, "revCount": 750,
"type": "git", "type": "git",
"url": "https://git.outfoxxed.me/outfoxxed/quickshell" "url": "https://git.outfoxxed.me/outfoxxed/quickshell"
}, },
@ -1044,11 +1061,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1772495394, "lastModified": 1773550941,
"narHash": "sha256-hmIvE/slLKEFKNEJz27IZ8BKlAaZDcjIHmkZ7GCEjfw=", "narHash": "sha256-wa/++bL2QeMUreNFBZEWluQfOYB0MnQIeGNMuaX9sfs=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "1d9b98a29a45abe9c4d3174bd36de9f28755e3ff", "rev": "c469b6885f0dcd5c7c56bd935a0f08dbcd9e79e1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1269,11 +1286,11 @@
"systems": "systems_6" "systems": "systems_6"
}, },
"locked": { "locked": {
"lastModified": 1771062828, "lastModified": 1773212610,
"narHash": "sha256-y1jBFFO0u+V21y3YldHZozrDwVJVrdC+o3c4M8/rasU=", "narHash": "sha256-jYvDe44MLx444BfiO1EtCKgHoKfXeIG1DvAw7P2qCrY=",
"owner": "abenz1267", "owner": "abenz1267",
"repo": "walker", "repo": "walker",
"rev": "19b1104585305e0806b842af341630f72038a4b9", "rev": "04ec7aa1b0cf2524370d99d43283c3050178a813",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1340,11 +1357,11 @@
"xwayland-satellite-unstable": { "xwayland-satellite-unstable": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1772429643, "lastModified": 1773499041,
"narHash": "sha256-M+bAeCCcjBnVk6w/4dIVvXvpJwOKnXjwi/lDbaN6Yws=", "narHash": "sha256-XZ4/tVdLeAYDgKe4JD4C7yYUKydMxwt8c2j6APFWcIc=",
"owner": "Supreeeme", "owner": "Supreeeme",
"repo": "xwayland-satellite", "repo": "xwayland-satellite",
"rev": "10f985b84cdbcc3bbf35b3e7e43d1b2a84fa9ce2", "rev": "309d8e2a29953f7465dc14c939e2afe4682c0aa9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1360,11 +1377,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1772685307, "lastModified": 1773290160,
"narHash": "sha256-5xthZHeqwBeXNhnRIlxnCuaZLky0SZ6vQsxtd+eqhTU=", "narHash": "sha256-u09eF4Oafi+OIbTtKe/EWil26q1glcTATiSA7dF1oCI=",
"owner": "youwen5", "owner": "youwen5",
"repo": "zen-browser-flake", "repo": "zen-browser-flake",
"rev": "dc92d88524ee83308795bc90f6a9f1d965265aaa", "rev": "c7cb51b30960757ed9fb8eb28567b32585d0a688",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -10,6 +10,7 @@
../../modules/nixos ../../modules/nixos
../../modules/nixos/core/nix-ld.nix ../../modules/nixos/core/nix-ld.nix
../../modules/nixos/core/nftables.nix ../../modules/nixos/core/nftables.nix
../../modules/nixos/core/binfmt.nix
# this is a laptop # this is a laptop
../../modules/nixos/desktop ../../modules/nixos/desktop
@ -45,7 +46,10 @@
# services # services
../../modules/nixos/services/docker.nix ../../modules/nixos/services/docker.nix
../../modules/nixos/services/exp.nix ../../modules/nixos/services/syncthing.nix
../../modules/nixos/services/tailscale.nix
# TODO: Configure restic backup (see the file for setup instructions)
# ../../modules/nixos/services/restic.nix
]; ];
# Hostname # Hostname

View file

@ -1,15 +1,4 @@
{...}: { {...}: {
# See: https://consoledonottrack.com/ # See: https://consoledonottrack.com/
home.sessionVariables = { home.sessionVariables = import ../lib/do-not-track-vars.nix;
DO_NOT_TRACK = "1";
GATSBY_TELEMETRY_DISABLED = "1";
HOMEBREW_NO_ANALYTICS = "1";
STNOUPGRADE = "1";
DOTNET_CLI_TELEMETRY_OPTOUT = "1";
SAM_CLI_TELEMETRY = "0";
AZURE_CORE_COLLECT_TELEMETRY = "0";
GEMINI_TELEMETRY_ENABLED = "false";
SCARF_NO_ANALYTICS = "true";
ANONYMIZED_TELEMETRY = "false";
};
} }

View file

@ -0,0 +1,14 @@
# Shared telemetry opt-out variables
# See: https://consoledonottrack.com/
{
DO_NOT_TRACK = "1";
GATSBY_TELEMETRY_DISABLED = "1";
HOMEBREW_NO_ANALYTICS = "1";
STNOUPGRADE = "1";
DOTNET_CLI_TELEMETRY_OPTOUT = "1";
SAM_CLI_TELEMETRY = "0";
AZURE_CORE_COLLECT_TELEMETRY = "0";
GEMINI_TELEMETRY_ENABLED = "false";
SCARF_NO_ANALYTICS = "true";
ANONYMIZED_TELEMETRY = "false";
}

View file

@ -0,0 +1,188 @@
# mergetools.nix — Dual-mode config merge library
#
# Supports both Home Manager ("home") and NixOS system-level ("system") modes.
# All targets are ABSOLUTE paths regardless of mode.
#
# Usage (home mode — default):
# mergetools = import ../../modules/lib/mergetools.nix { inherit pkgs lib config; };
# myConfig = mergetools.mkMergedJson {
# name = "my-config";
# target = "${config.home.homeDirectory}/.config/app/config.json";
# settings = { key = "value"; };
# };
# # Then: imports = [ myConfig ];
#
# Usage (system mode):
# mergetools = import ../../modules/lib/mergetools.nix { inherit pkgs lib config; };
# myConfig = mergetools.mkMergedJson {
# name = "my-config";
# target = "/var/lib/myapp/config.json";
# settings = { key = "value"; };
# mode = "system";
# # owner = "myapp"; # default: "root"
# # group = "myapp"; # default: "root"
# # permissions = "0640"; # default: "0644"
# };
# # Then: imports = [ myConfig ];
{
config,
lib,
pkgs,
...
}: let
mkForceVar = force:
if force
then "true"
else "false";
# Derive a safe relative path for home.file from an absolute target.
# Strips the leading $HOME/ to get the relative portion.
# e.g., "/home/js0ny/.config/foo" -> ".config/foo"
stripHomePrefix = target: let
homeDir = config.home.homeDirectory;
homeDirSlash = homeDir + "/";
len = builtins.stringLength homeDirSlash;
in
if lib.hasPrefix homeDirSlash target
then builtins.substring len (builtins.stringLength target - len) target
else builtins.abort "mergetools (home mode): target '${target}' must start with '${homeDirSlash}'";
# ── Home mode ──────────────────────────────────────────────────────
mkHomeMerge = {
name,
target,
patchContent,
mergeCmdStr,
force,
emptyInit,
}: let
relTarget = stripHomePrefix target;
patchFile = "${relTarget}.nix-managed";
in {
home.file."${patchFile}".text = patchContent;
home.activation."merge-${name}" = lib.hm.dag.entryAfter ["writeBoundary"] ''
TARGET="${target}"
PATCH="$HOME/${patchFile}"
FORCE="${mkForceVar force}"
if [ -f "$TARGET" ] || [ "$FORCE" = "true" ]; then
if [ -f "$PATCH" ]; then
verboseEcho "Merging Nix managed config into: $TARGET"
run mkdir -p "$(dirname "$TARGET")"
if [ ! -f "$TARGET" ]; then
echo '${emptyInit}' > "$TARGET"
fi
run ${mergeCmdStr}
fi
else
verboseEcho "Skipping merge for $TARGET: file missing and force=false"
fi
'';
};
# ── System mode ────────────────────────────────────────────────────
mkSystemMerge = {
name,
target,
patchContent,
mergeCmdStr,
force,
emptyInit,
owner ? "root",
group ? "root",
permissions ? "0644",
}: let
patchFile = pkgs.writeText "${name}.nix-managed" patchContent;
in {
system.activationScripts."merge-${name}" = lib.stringAfter ["etc"] ''
TARGET="${target}"
PATCH="${patchFile}"
FORCE="${mkForceVar force}"
if [ -f "$TARGET" ] || [ "$FORCE" = "true" ]; then
echo "mergetools: Merging Nix managed config into: $TARGET"
mkdir -p "$(dirname "$TARGET")"
if [ ! -f "$TARGET" ]; then
echo '${emptyInit}' > "$TARGET"
fi
${mergeCmdStr}
chown ${owner}:${group} "$TARGET"
chmod ${permissions} "$TARGET"
else
echo "mergetools: Skipping merge for $TARGET: file missing and force=false"
fi
'';
};
# ── Dispatch ───────────────────────────────────────────────────────
mkMerge = {mode ? "home", ...} @ args: let
# Strip mode-irrelevant attrs before passing
homeArgs = builtins.removeAttrs args ["mode" "owner" "group" "permissions"];
systemArgs = builtins.removeAttrs args ["mode"];
in
if mode == "home"
then mkHomeMerge homeArgs
else if mode == "system"
then mkSystemMerge systemArgs
else builtins.abort "mergetools: unknown mode '${mode}', expected 'home' or 'system'";
# ── Public API ─────────────────────────────────────────────────────
mkMergedYaml = {
name,
target,
settings,
force ? false,
mode ? "home",
owner ? "root",
group ? "root",
permissions ? "0644",
}:
mkMerge {
inherit name target mode force owner group permissions;
patchContent = lib.generators.toYAML {} settings;
# $TARGET and $PATCH are shell variables set in the activation script
mergeCmdStr = ''${pkgs.yq-go}/bin/yq -i -oy -P ". *= load(\"$PATCH\")" "$TARGET"'';
emptyInit = "{}";
};
mkMergedJson = {
name,
target,
settings,
force ? false,
mode ? "home",
owner ? "root",
group ? "root",
permissions ? "0644",
}:
mkMerge {
inherit name target mode force owner group permissions;
patchContent = builtins.toJSON settings;
mergeCmdStr = ''${pkgs.yq-go}/bin/yq -i -o json -P --indent 2 ". *= load(\"$PATCH\")" "$TARGET"'';
emptyInit = "{}";
};
mkMergedIni = {
name,
target,
settings,
force ? false,
mode ? "home",
owner ? "root",
group ? "root",
permissions ? "0644",
}:
mkMerge {
inherit name target mode force owner group permissions;
patchContent = lib.generators.toINI {} settings;
mergeCmdStr = ''${pkgs.crudini}/bin/crudini --merge "$TARGET" < "$PATCH"'';
emptyInit = "";
};
in {
inherit mkMergedYaml mkMergedJson mkMergedIni;
}

View file

@ -0,0 +1,3 @@
{...}: {
boot.binfmt.emulatedSystems = ["aarch64-linux"];
}

View file

@ -1,15 +1,4 @@
{...}: { {...}: {
# See: https://consoledonottrack.com/ # See: https://consoledonottrack.com/
environment.variables = { environment.variables = import ../../lib/do-not-track-vars.nix;
DO_NOT_TRACK = "1";
GATSBY_TELEMETRY_DISABLED = "1";
HOMEBREW_NO_ANALYTICS = "1";
STNOUPGRADE = "1";
DOTNET_CLI_TELEMETRY_OPTOUT = "1";
SAM_CLI_TELEMETRY = "0";
AZURE_CORE_COLLECT_TELEMETRY = "0";
GEMINI_TELEMETRY_ENABLED = "false";
SCARF_NO_ANALYTICS = "true";
ANONYMIZED_TELEMETRY = "false";
};
} }

View file

@ -2,6 +2,7 @@
imports = [ imports = [
./xremap.nix ./xremap.nix
./diskutil.nix ./diskutil.nix
../hardware/pipewire.nix
]; ];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View file

@ -0,0 +1,19 @@
{...}: {
environment.etc."wireplumber/wireplumber.conf.d/51-rename-alsa-devices.conf".text = ''
monitor.alsa.rules = [
{
matches = [
{
node.name = "alsa_input.pci-0000_65_00.6.analog-stereo"
}
]
actions = {
update-props = {
node.description = ""
}
}
}
]
'';
}

View file

@ -0,0 +1,82 @@
# TODO: Configure restic backup
#
# This is a skeleton for services.restic.backups.
# NixOS provides `services.restic.backups.<name>` which creates systemd
# timers that run restic backup on a schedule.
#
# Steps to complete:
# 1. Add a restic repository password to sops secrets:
# In secrets/secrets.yaml, add:
# restic_repo_password: "your-secure-password"
# Then reference it below via sops.secrets."RESTIC_REPO_PASSWORD"
#
# 2. Choose a backup repository backend and set `repository`:
# - Local: "/mnt/backup/restic-repo"
# - SFTP: "sftp:user@host:/path/to/repo"
# - S3: "s3:https://s3.amazonaws.com/bucket-name"
# - B2: "b2:bucket-name:/"
# - Rclone: "rclone:remote:path"
#
# 3. For cloud backends, add credential env vars:
# - S3: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
# - B2: B2_ACCOUNT_ID, B2_ACCOUNT_KEY
# Store these in sops and pass them via `environmentFile`
#
# 4. Set `paths` to directories you want to back up
#
# 5. Set `exclude` patterns for files to skip
#
# 6. Set `timerConfig` for backup schedule (systemd timer syntax)
#
# 7. Optionally configure `pruneOpts` for automatic old snapshot cleanup
#
# 8. Initialize the repo: `restic -r <repository> init`
#
{config, ...}: {
services.restic.backups = {
# TODO: Rename this backup job as needed
main = {
# TODO: Set your restic repository URL (see step 2 above)
repository = "/mnt/backup/restic-repo";
# TODO: Add "RESTIC_REPO_PASSWORD" to sops secrets, then uncomment:
# passwordFile = config.sops.secrets."RESTIC_REPO_PASSWORD".path;
# TODO: For cloud backends, create an env file with credentials:
# environmentFile = config.sops.secrets."RESTIC_ENV".path;
# TODO: Set directories to back up
paths = [
# "/home/js0ny/Documents"
# "/home/js0ny/Projects"
# "/home/js0ny/Academia"
];
# TODO: Set exclude patterns
exclude = [
".cache"
".local/share/Trash"
"node_modules"
".venv"
"__pycache__"
"target" # Rust/Maven build artifacts
"result" # Nix build results
];
# TODO: Set backup schedule (default: daily at 3am)
timerConfig = {
OnCalendar = "daily";
Persistent = true; # Run missed backups after sleep/shutdown
RandomizedDelaySec = "1h";
};
# TODO: Uncomment to enable automatic snapshot pruning
# pruneOpts = [
# "--keep-daily 7"
# "--keep-weekly 4"
# "--keep-monthly 6"
# "--keep-yearly 2"
# ];
};
};
}

View file

@ -1,4 +1,3 @@
{...}: { {...}: {
services.syncthing.enable = true; services.syncthing.enable = true;
services.tailscale.enable = true;
} }

View file

@ -0,0 +1,3 @@
{...}: {
services.tailscale.enable = true;
}

View file

@ -1,14 +0,0 @@
{pkgs, ...}: {
my = {
desktop = {
preferredApps = {
shell = pkgs.zsh;
interactiveShell = pkgs.fish;
terminal = {
package = pkgs.kitty;
execArg = "-e";
};
};
};
};
}

View file

@ -9,7 +9,6 @@ in {
imports = [ imports = [
../../modules/home/options.nix ../../modules/home/options.nix
../../modules/home/do-not-track.nix ../../modules/home/do-not-track.nix
# ./config.nix
]; ];
home.username = username; home.username = username;
home.homeDirectory = home.homeDirectory =

View file

@ -1,119 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
# Helper to handle the logic check string
# 如果 force 为 trueBash 变量 FORCE 为 "true",否则为 "false"
# In Nix, (toString true) yields "1"
mkForceVar = force:
if force
then "true"
else "false";
mkMergedYaml = {
name,
target,
settings,
force ? false,
}: let
yamlContent = lib.generators.toYAML {} settings;
patchFile = "${target}.nix-managed";
in {
home.file."${patchFile}".text = yamlContent;
home.activation."merge-${name}" = lib.hm.dag.entryAfter ["writeBoundary"] ''
TARGET="$HOME/${target}"
PATCH="$HOME/${patchFile}"
FORCE="${mkForceVar force}"
if [ -f "$TARGET" ] || [ "$FORCE" = "true" ]; then
if [ -f "$PATCH" ]; then
verboseEcho "Merging Nix managed YAML config into: $TARGET"
# 只有在确定要操作时,才创建目录和空文件
run mkdir -p "$(dirname "$TARGET")"
if [ ! -f "$TARGET" ]; then
echo "{}" > "$TARGET"
fi
run ${pkgs.yq-go}/bin/yq -i -oy -P ". *= load(\"$PATCH\")" "$TARGET"
fi
else
verboseEcho "Skipping merge for $TARGET: file missing and force=false"
fi
'';
};
mkMergedJson = {
name,
target,
settings,
force ? false,
}: let
jsonContent = builtins.toJSON settings;
patchFile = "${target}.nix-managed";
in {
home.file."${patchFile}".text = jsonContent;
home.activation."merge-${name}" = lib.hm.dag.entryAfter ["writeBoundary"] ''
TARGET="$HOME/${target}"
PATCH="$HOME/${patchFile}"
FORCE="${mkForceVar force}"
if [ -f "$TARGET" ] || [ "$FORCE" = "true" ]; then
if [ -f "$PATCH" ]; then
verboseEcho "Merging Nix managed JSON config into: $TARGET"
run mkdir -p "$(dirname "$TARGET")"
if [ ! -f "$TARGET" ]; then
echo "{}" > "$TARGET"
fi
run ${pkgs.yq-go}/bin/yq -i -o json -P --indent 2 ". *= load(\"$PATCH\")" "$TARGET"
fi
else
verboseEcho "Skipping merge for $TARGET: file missing and force=false"
fi
'';
};
mkMergedIni = {
name,
target,
settings,
force ? false,
}: let
iniContent = lib.generators.toINI {} settings;
patchFile = "${target}.nix-managed";
in {
home.file."${patchFile}".text = iniContent;
home.activation."merge-${name}" = lib.hm.dag.entryAfter ["writeBoundary"] ''
TARGET="$HOME/${target}"
PATCH="$HOME/${patchFile}"
FORCE="${mkForceVar force}"
if [ -f "$TARGET" ] || [ "$FORCE" = "true" ]; then
if [ -f "$PATCH" ]; then
verboseEcho "Merging Nix managed INI config into: $TARGET"
run mkdir -p "$(dirname "$TARGET")"
if [ ! -f "$TARGET" ]; then
echo "" > "$TARGET"
fi
run ${pkgs.crudini}/bin/crudini --merge "$TARGET" < "$PATCH"
fi
else
verboseEcho "Skipping merge for $TARGET: file missing and force=false"
fi
'';
};
in {
inherit mkMergedYaml mkMergedJson mkMergedIni;
}

View file

@ -73,6 +73,8 @@
visidata visidata
proton-pass-cli proton-pass-cli
pass pass
# rar: Unfree, the only way (afaik) to unarchive some very old partition rars
rar
] ]
++ ( ++ (
if pkgs.stdenv.isDarwin if pkgs.stdenv.isDarwin

View file

@ -28,6 +28,6 @@
systemd.user.tmpfiles.rules = [ systemd.user.tmpfiles.rules = [
"d ${config.xdg.dataHome}/cargo 0755 ${config.home.username} users -" "d ${config.xdg.dataHome}/cargo 0755 ${config.home.username} users -"
"d ${config.xdg.dataHome}/go 0755 ${config.home.username} users -" "d ${config.xdg.dataHome}/go 0755 ${config.home.username} users -"
"f ${config.xdg.stateHome}/python 0755 ${config.home.username} users -" "d ${config.xdg.stateHome}/python 0755 ${config.home.username} users -"
]; ];
} }

View file

@ -5,10 +5,10 @@
... ...
}: let }: let
noname = pkgs.callPackage ../../../pkgs/noname/default.nix {}; noname = pkgs.callPackage ../../../pkgs/noname/default.nix {};
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;}; mergetools = import ../../../modules/lib/mergetools.nix {inherit pkgs lib config;};
mkMergedJson = mergetools.mkMergedJson; mkMergedJson = mergetools.mkMergedJson;
mkMergedIni = mergetools.mkMergedIni; mkMergedIni = mergetools.mkMergedIni;
pdxrel = ".local/share/Paradox Interactive"; pdxrel = "${config.home.homeDirectory}/.local/share/Paradox Interactive";
# pdxbase = "${config.home.homeDirectory}/${pdxrel}"; # pdxbase = "${config.home.homeDirectory}/${pdxrel}";
euvbase = "${config.home.homeDirectory}/.local/share/Steam/steamapps/compatdata/3450310/pfx/drive_c/users/steamuser/Documents/Paradox Interactive/Europa Universalis V"; euvbase = "${config.home.homeDirectory}/.local/share/Steam/steamapps/compatdata/3450310/pfx/drive_c/users/steamuser/Documents/Paradox Interactive/Europa Universalis V";
paradoxLauncherUserSettings = mkMergedJson { paradoxLauncherUserSettings = mkMergedJson {
@ -29,7 +29,7 @@
# 经典 $HOME 下拉屎 # 经典 $HOME 下拉屎
pdxSdkSettingsV3 = mkMergedJson { pdxSdkSettingsV3 = mkMergedJson {
name = "pdxSdkaccountJsonV3"; name = "pdxSdkaccountJsonV3";
target = "PDX/SDK/victoria3/account.json"; target = "${config.home.homeDirectory}/PDX/SDK/victoria3/account.json";
settings = { settings = {
telemetryEnabled = false; telemetryEnabled = false;
}; };
@ -43,7 +43,7 @@
}; };
pdxSdkTelemetryV3 = mkMergedJson { pdxSdkTelemetryV3 = mkMergedJson {
name = "pdxSdktelemetryConsentV3"; name = "pdxSdktelemetryConsentV3";
target = "PDX/SDK/victoria3/telemetry_consent.json"; target = "${config.home.homeDirectory}/PDX/SDK/victoria3/telemetry_consent.json";
settings = { settings = {
telemetry_consent_choice = "denied"; telemetry_consent_choice = "denied";
}; };
@ -65,7 +65,7 @@
}; };
prismLauncherCfg = mkMergedIni { prismLauncherCfg = mkMergedIni {
name = "prism-launcher-config"; name = "prism-launcher-config";
target = ".local/share/PrismLauncher/prismlauncher.cfg"; target = "${config.home.homeDirectory}/.local/share/PrismLauncher/prismlauncher.cfg";
settings = { settings = {
General = { General = {
Language = "zh"; Language = "zh";
@ -85,7 +85,7 @@
}; };
ryujinxConfig = mkMergedJson { ryujinxConfig = mkMergedJson {
name = "ryujinx-config"; name = "ryujinx-config";
target = ".config/Ryujinx/Config.json"; target = "${config.home.homeDirectory}/.config/Ryujinx/Config.json";
settings = { settings = {
game_dir = [ game_dir = [
"${config.home.homeDirectory}/Games/ROM/Nintendo - Nintendo Switch" "${config.home.homeDirectory}/Games/ROM/Nintendo - Nintendo Switch"

View file

@ -117,6 +117,8 @@ in {
readest readest
openclaw openclaw
kid3
# Use Wayland for Jetbrains # Use Wayland for Jetbrains
# (jetbrains.idea-ultimate.override { # (jetbrains.idea-ultimate.override {
# vmopts = ''-Dawt.toolkit.name=WLToolkit''; # vmopts = ''-Dawt.toolkit.name=WLToolkit'';

View file

@ -4,11 +4,11 @@
config, config,
... ...
}: let }: let
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;}; mergetools = import ../../../modules/lib/mergetools.nix {inherit pkgs lib config;};
mkMergedJson = mergetools.mkMergedJson; mkMergedJson = mergetools.mkMergedJson;
cherryStudioConfig = mkMergedJson { cherryStudioConfig = mkMergedJson {
name = "cherry-studio-config"; name = "cherry-studio-config";
target = ".config/cherry-studio/config.json"; target = "${config.home.homeDirectory}/.config/cherry-studio/config.json";
settings = { settings = {
enableDeveloperMode = true; enableDeveloperMode = true;
enableDataCollection = false; enableDataCollection = false;

View file

@ -61,16 +61,19 @@ in {
# spawn-sh "cliphist list | ${launcher} -dmenu | cliphist decode | wl-copy"; # spawn-sh "cliphist list | ${launcher} -dmenu | cliphist decode | wl-copy";
spawn "${launcher}" "-m" "clipboard"; spawn "${launcher}" "-m" "clipboard";
# See ../volume-notify.nix
"XF86AudioRaiseVolume".allow-when-locked = true; "XF86AudioRaiseVolume".allow-when-locked = true;
"XF86AudioRaiseVolume".action = "XF86AudioRaiseVolume".action =
spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; spawn "volume-notify" "up";
"XF86AudioLowerVolume".allow-when-locked = true; "XF86AudioLowerVolume".allow-when-locked = true;
"XF86AudioLowerVolume".action = "XF86AudioLowerVolume".action =
spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; spawn "volume-notify" "down";
"XF86AudioMute".allow-when-locked = true; "XF86AudioMute".allow-when-locked = true;
"XF86AudioMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; "XF86AudioMute".action =
spawn "volume-notify" "mute";
"XF86AudioMicMute".allow-when-locked = true; "XF86AudioMicMute".allow-when-locked = true;
"XF86AudioMicMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; "XF86AudioMicMute".action =
spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle";
"XF86MonBrightnessUp" = { "XF86MonBrightnessUp" = {
action = spawn "brightnessctl" "set" "10%+"; action = spawn "brightnessctl" "set" "10%+";

View file

@ -48,6 +48,7 @@ in {
./sunsetr.nix ./sunsetr.nix
./systemd.nix ./systemd.nix
./dunst.nix ./dunst.nix
./volume-notify.nix
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [
swayidle # Screensaver swayidle # Screensaver

View file

@ -0,0 +1,46 @@
{pkgs, ...}: let
volume-notify = pkgs.writeShellApplication {
name = "volume-notify";
runtimeInputs = with pkgs; [
wireplumber
gawk
gnugrep
libnotify
];
text = ''
if [ $# -eq 0 ]; then
echo "Usage: volume-notify {up|down|mute}"
exit 1
fi
case "$1" in
up)
wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+
;;
down)
wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-
;;
mute)
wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
;;
*)
echo "Invalid argument: $1"
exit 1
;;
esac
if wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q 'MUTED'; then
TEXT="Volume: Muted"
else
VOLUME=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2 * 100}')
TEXT="Volume: ''${VOLUME}%"
fi
notify-send -h string:x-canonical-private-synchronous:volume -t 1500 "🔊 Audio" "$TEXT"
'';
};
in {
home.packages = [volume-notify];
}

View file

@ -4,12 +4,12 @@
config, config,
... ...
}: let }: let
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;}; mergetools = import ../../../modules/lib/mergetools.nix {inherit pkgs lib config;};
mkMergeIni = mergetools.mkMergedIni; mkMergeIni = mergetools.mkMergedIni;
# username = config.home.username; # username = config.home.username;
fsearchConf = mkMergeIni { fsearchConf = mkMergeIni {
name = "fsearch-conf"; name = "fsearch-conf";
target = ".config/fsearch/fsearch.conf"; target = "${config.home.homeDirectory}/.config/fsearch/fsearch.conf";
settings = { settings = {
Interface = { Interface = {
single_click_open = false; single_click_open = false;

View file

@ -22,8 +22,31 @@
fi fi
''; '';
}; };
ii-fzf = pkgs.writeShellApplication {
name = "ii-fzf";
runtimeInputs = with pkgs; [fzf];
text = ''
_file=""
if command -v fd >/dev/null 2>&1; then
_file=$(fd --type f --exclude '*.lock' | fzf --height 40% --reverse -1 -q "''${1:-}")
else
# Fallback to 'find'
_file=$(find . -type f ! -name '*.lock' | fzf --height 40% --reverse -1 -q "''${1:-}")
fi
# In POSIX shell, if fzf is cancelled (Esc/Ctrl-C),
# the command substitution simply returns an empty string.
# So, we check if the variable '_file' is non-empty ('-n').
if [ -n "$_file" ]; then
xdg-open "$_file"
else
echo "No file selected."
fi
'';
};
in { in {
home.packages = [edit-fzf]; home.packages = [edit-fzf ii-fzf];
programs.fzf = { programs.fzf = {
enable = true; enable = true;
enableBashIntegration = true; enableBashIntegration = true;

View file

@ -17,11 +17,13 @@
echo "marketplaceID: 12" >> "$out/theme.yml" echo "marketplaceID: 12" >> "$out/theme.yml"
echo 'version: "25.02"' >> "$out/theme.yml" echo 'version: "25.02"' >> "$out/theme.yml"
''; '';
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;}; mergetools =
import ../../../../../modules/lib/mergetools.nix
{inherit pkgs lib config;};
mkMergedYaml = mergetools.mkMergedYaml; mkMergedYaml = mergetools.mkMergedYaml;
ciderSpaConfig = mkMergedYaml { ciderSpaConfig = mkMergedYaml {
name = "cider-spa-config"; name = "cider-spa-config";
target = ".config/sh.cider.genten/spa-config.yml"; target = "${config.home.homeDirectory}/.config/sh.cider.genten/spa-config.yml";
settings = { settings = {
general = { general = {
language = "zh-CN"; language = "zh-CN";
@ -35,8 +37,8 @@
appearance = "auto"; appearance = "auto";
# default: Mojave # default: Mojave
useAdaptiveColors = true; useAdaptiveColors = true;
# TODO: Change to "native" when using simple WM # NOTE: "native" breaks window controls on tiling WMs (Electron bug).
# Electron does not render the three buttons in title bar when "native" # "default" works on both GNOME and Niri, so keep it.
titleBarStyle = "default"; titleBarStyle = "default";
layoutType = "default"; layoutType = "default";
fonts = { fonts = {
@ -81,7 +83,7 @@
}; };
in { in {
imports = [ imports = [
../../../modules/home/programs/cider-2.nix ./lib.nix
ciderSpaConfig ciderSpaConfig
]; ];

View file

@ -4,11 +4,11 @@
lib, lib,
... ...
}: let }: let
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;}; mergetools = import ../../../../modules/lib/mergetools.nix {inherit pkgs lib config;};
mkMergeIni = mergetools.mkMergedIni; mkMergeIni = mergetools.mkMergedIni;
elisarc = mkMergeIni { elisarc = mkMergeIni {
name = "elisarc"; name = "elisarc";
target = ".config/elisarc"; target = "${config.home.homeDirectory}/.config/elisarc";
settings = { settings = {
ElisaFileIndexer = { ElisaFileIndexer = {
"RootPath[$e]" = "$HOME/Music"; "RootPath[$e]" = "$HOME/Music";

View file

@ -4,11 +4,11 @@
config, config,
... ...
}: let }: let
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;}; mergetools = import ../../../../modules/lib/mergetools.nix {inherit pkgs lib config;};
mkMergedJson = mergetools.mkMergedJson; mkMergedJson = mergetools.mkMergedJson;
feishinConfig = mkMergedJson { feishinConfig = mkMergedJson {
name = "feishin-config"; name = "feishin-config";
target = ".config/feishin/config.json"; target = "${config.home.homeDirectory}/.config/feishin/config.json";
settings = { settings = {
theme = "system"; theme = "system";
window_has_frame = false; window_has_frame = false;

View file

@ -14,7 +14,7 @@
exit 1 exit 1
} }
# TODO: Add tag search support # DEPRECATED: Consider removing in favour of Obsidian's official CLI.
rg --line-number --color=always "" | rg --line-number --color=always "" |
fzf --ansi \ fzf --ansi \
--delimiter : \ --delimiter : \

View file

@ -4,11 +4,11 @@
config, config,
... ...
}: let }: let
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;}; mergetools = import ../../../../modules/lib/mergetools.nix {inherit pkgs lib config;};
mkMergedJson = mergetools.mkMergedJson; mkMergedJson = mergetools.mkMergedJson;
readestSettings = mkMergedJson { readestSettings = mkMergedJson {
name = "readest-settings"; name = "readest-settings";
target = ".config/com.bilingify.readest/settings.json"; target = "${config.home.homeDirectory}/.config/com.bilingify.readest/settings.json";
settings = { settings = {
globalViewSettings = { globalViewSettings = {
serifFont = "LXGW WenKai GB Screen"; serifFont = "LXGW WenKai GB Screen";

View file

@ -15,30 +15,29 @@
# Programs # Programs
./programs/aichat.nix ./programs/aichat.nix
./programs/firefox ./programs/browsers/firefox
./programs/emacs.nix ./programs/editors/emacs.nix
./programs/zed-editor.nix ./programs/editors/zed-editor.nix
./programs/rime ./programs/rime
./programs/sdcv.nix ./programs/productivity/sdcv.nix
./programs/fzf.nix ./programs/fzf.nix
./programs/sops.nix ./programs/sops.nix
./programs/nvim.nix ./programs/editors/nvim.nix
./programs/pdf2zh/uv.nix ./programs/pdf2zh/uv.nix
./programs/yazi.nix ./programs/yazi.nix
./programs/edit-clipboard.nix ./programs/edit-clipboard.nix
./programs/neovide.nix ./programs/editors/neovide.nix
./programs/ghostty.nix ./programs/terminals/ghostty.nix
./programs/tmux.nix ./programs/terminals/tmux.nix
./programs/kitty.nix ./programs/terminals/kitty.nix
./programs/anki.nix ./programs/productivity/anki.nix
./programs/sioyek ./programs/productivity/sioyek
./programs/telegram.nix ./programs/social/telegram.nix
# ./programs/retroarch.nix # Package broken on macOS # ./programs/retroarch.nix # Package broken on macOS
./programs/darwin/duti.nix ./programs/darwin/duti.nix
./programs/darwin/alt-tab.nix ./programs/darwin/alt-tab.nix
./programs/darwin/iina.nix ./programs/darwin/iina.nix
../../modules/home/do-not-track.nix
../../modules/home/darwin.nix ../../modules/home/darwin.nix
../../modules/home/programs/lsd.nix ../../modules/home/programs/lsd.nix

View file

@ -32,19 +32,51 @@ in {
./programs/shell/carapace.nix ./programs/shell/carapace.nix
./programs/shell/direnv.nix ./programs/shell/direnv.nix
# Personal Program # Browsers
./programs/chromium.nix ./programs/browsers/chromium.nix
./programs/firefox ./programs/browsers/firefox
./programs/emacs.nix
./programs/vscode.nix # Editors
./programs/editors/emacs.nix
./programs/editors/nvim.nix
./programs/editors/neovide.nix
./programs/editors/vscode.nix
./programs/editors/zed-editor.nix
# Terminals
./programs/terminals/ghostty.nix
./programs/terminals/kitty.nix
./programs/terminals/tmux.nix
# Media
./programs/media/cider-2
./programs/media/celluloid.nix
./programs/media/elisa.nix
./programs/media/feishin.nix
./programs/media/gallery-dl.nix
./programs/media/lollypop.nix
./programs/media/mpv.nix
./programs/media/obs-studio.nix
./programs/media/picard.nix
# Productivity
./programs/productivity/anki.nix
./programs/productivity/libreoffice.nix
./programs/productivity/obsidian
./programs/productivity/readest.nix
./programs/productivity/sdcv.nix
./programs/productivity/sioyek
./programs/productivity/thunderbird.nix
# Social
./programs/social/discord.nix
./programs/social/telegram.nix
# Utilities & misc
# ./programs/xilinx.nix # ./programs/xilinx.nix
./programs/mime.nix ./programs/mime.nix
./programs/zed-editor.nix
./programs/rime ./programs/rime
./programs/sdcv.nix
./programs/fzf.nix ./programs/fzf.nix
./programs/libreoffice.nix
./programs/nvim.nix
./programs/ollama.nix ./programs/ollama.nix
./programs/sops.nix ./programs/sops.nix
./programs/pdf2zh/container.nix ./programs/pdf2zh/container.nix
@ -54,34 +86,14 @@ in {
./programs/magick.nix ./programs/magick.nix
./programs/miniserve.nix ./programs/miniserve.nix
./programs/retroarch.nix ./programs/retroarch.nix
./programs/neovide.nix
./programs/edit-clipboard.nix ./programs/edit-clipboard.nix
./programs/discord.nix
./programs/mpv.nix
./programs/thunderbird.nix
./programs/obs-studio.nix
./programs/ghostty.nix
./programs/obsidian
./programs/aichat.nix ./programs/aichat.nix
./programs/tmux.nix
./programs/kitty.nix
./programs/wine.nix ./programs/wine.nix
./programs/anki.nix
./programs/libvirt.nix ./programs/libvirt.nix
./programs/block-desktop-entries.nix ./programs/block-desktop-entries.nix
./programs/pwa.nix ./programs/pwa.nix
./programs/walker.nix ./programs/walker.nix
./programs/sioyek
./programs/celluloid.nix
./programs/picard.nix
./programs/cider-2.nix
./programs/telegram.nix
./programs/feishin.nix
./programs/fsearch.nix ./programs/fsearch.nix
./programs/elisa.nix
./programs/lollypop.nix
./programs/gallery-dl.nix
./programs/readest.nix
# ./programs/openclaw.nix # ./programs/openclaw.nix
./programs/libmagic.nix ./programs/libmagic.nix
@ -91,8 +103,6 @@ in {
./programs/desktop/gnome/copyous.nix ./programs/desktop/gnome/copyous.nix
./programs/desktop/wayland-wm/niri ./programs/desktop/wayland-wm/niri
../../modules/home/do-not-track.nix
# General Program config # General Program config
../../modules/home/programs/eza.nix ../../modules/home/programs/eza.nix
# ../../modules/home/programs/winboat.nix # ../../modules/home/programs/winboat.nix