mirror of
https://github.com/js0ny/dotfiles.git
synced 2026-03-21 18:26:20 +00:00
chore: reorg
This commit is contained in:
parent
e0a023da4f
commit
1b5c26bc04
54 changed files with 411 additions and 227 deletions
|
|
@ -57,43 +57,4 @@ if vim.g.neovide then
|
|||
vim.g.neovide_input_macos_option_key_is_meta = "only_left"
|
||||
end
|
||||
|
||||
-- TODO: Refractor this part to submodules
|
||||
-- 存储输入法状态的变量
|
||||
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,
|
||||
})
|
||||
require("config.fcitx")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
-- This file *currently* contains the colorscheme for lualine (status line)
|
||||
|
||||
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
|
||||
M.scheme = require("catppuccin.palettes.latte")
|
||||
|
|
|
|||
27
home/dot_config/nvim/lua/config/fcitx.lua
Normal file
27
home/dot_config/nvim/lua/config/fcitx.lua
Normal 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,
|
||||
})
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
-- TODO:
|
||||
-- Debugger setups
|
||||
return {
|
||||
{
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ M.progress = {
|
|||
"progress",
|
||||
}
|
||||
|
||||
-- TODO: Implement orgmode
|
||||
M.orgmode = {
|
||||
function()
|
||||
return _G.orgmode.statusline()
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
../../modules/nixos
|
||||
../../modules/nixos/core/nix-ld.nix
|
||||
../../modules/nixos/core/nftables.nix
|
||||
../../modules/nixos/core/binfmt.nix
|
||||
|
||||
# this is a laptop
|
||||
../../modules/nixos/desktop
|
||||
|
|
@ -47,6 +48,8 @@
|
|||
../../modules/nixos/services/docker.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
|
||||
|
|
|
|||
188
nixcfgs/modules/lib/mergetools.nix
Normal file
188
nixcfgs/modules/lib/mergetools.nix
Normal 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;
|
||||
}
|
||||
3
nixcfgs/modules/nixos/core/binfmt.nix
Normal file
3
nixcfgs/modules/nixos/core/binfmt.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{...}: {
|
||||
boot.binfmt.emulatedSystems = ["aarch64-linux"];
|
||||
}
|
||||
82
nixcfgs/modules/nixos/services/restic.nix
Normal file
82
nixcfgs/modules/nixos/services/restic.nix
Normal 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"
|
||||
# ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
# Helper to handle the logic check string
|
||||
# 如果 force 为 true,Bash 变量 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;
|
||||
}
|
||||
|
|
@ -73,6 +73,8 @@
|
|||
visidata
|
||||
proton-pass-cli
|
||||
pass
|
||||
# rar: Unfree, the only way (afaik) to unarchive some very old partition rars
|
||||
rar
|
||||
]
|
||||
++ (
|
||||
if pkgs.stdenv.isDarwin
|
||||
|
|
|
|||
|
|
@ -28,6 +28,6 @@
|
|||
systemd.user.tmpfiles.rules = [
|
||||
"d ${config.xdg.dataHome}/cargo 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 -"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@
|
|||
...
|
||||
}: let
|
||||
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;
|
||||
mkMergedIni = mergetools.mkMergedIni;
|
||||
pdxrel = ".local/share/Paradox Interactive";
|
||||
pdxrel = "${config.home.homeDirectory}/.local/share/Paradox Interactive";
|
||||
# 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";
|
||||
paradoxLauncherUserSettings = mkMergedJson {
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
# 经典 $HOME 下拉屎
|
||||
pdxSdkSettingsV3 = mkMergedJson {
|
||||
name = "pdxSdkaccountJsonV3";
|
||||
target = "PDX/SDK/victoria3/account.json";
|
||||
target = "${config.home.homeDirectory}/PDX/SDK/victoria3/account.json";
|
||||
settings = {
|
||||
telemetryEnabled = false;
|
||||
};
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
};
|
||||
pdxSdkTelemetryV3 = mkMergedJson {
|
||||
name = "pdxSdktelemetryConsentV3";
|
||||
target = "PDX/SDK/victoria3/telemetry_consent.json";
|
||||
target = "${config.home.homeDirectory}/PDX/SDK/victoria3/telemetry_consent.json";
|
||||
settings = {
|
||||
telemetry_consent_choice = "denied";
|
||||
};
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
};
|
||||
prismLauncherCfg = mkMergedIni {
|
||||
name = "prism-launcher-config";
|
||||
target = ".local/share/PrismLauncher/prismlauncher.cfg";
|
||||
target = "${config.home.homeDirectory}/.local/share/PrismLauncher/prismlauncher.cfg";
|
||||
settings = {
|
||||
General = {
|
||||
Language = "zh";
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
};
|
||||
ryujinxConfig = mkMergedJson {
|
||||
name = "ryujinx-config";
|
||||
target = ".config/Ryujinx/Config.json";
|
||||
target = "${config.home.homeDirectory}/.config/Ryujinx/Config.json";
|
||||
settings = {
|
||||
game_dir = [
|
||||
"${config.home.homeDirectory}/Games/ROM/Nintendo - Nintendo Switch"
|
||||
|
|
|
|||
|
|
@ -117,6 +117,8 @@ in {
|
|||
readest
|
||||
openclaw
|
||||
|
||||
kid3
|
||||
|
||||
# Use Wayland for Jetbrains
|
||||
# (jetbrains.idea-ultimate.override {
|
||||
# vmopts = ''-Dawt.toolkit.name=WLToolkit'';
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;};
|
||||
mergetools = import ../../../modules/lib/mergetools.nix {inherit pkgs lib config;};
|
||||
mkMergedJson = mergetools.mkMergedJson;
|
||||
cherryStudioConfig = mkMergedJson {
|
||||
name = "cherry-studio-config";
|
||||
target = ".config/cherry-studio/config.json";
|
||||
target = "${config.home.homeDirectory}/.config/cherry-studio/config.json";
|
||||
settings = {
|
||||
enableDeveloperMode = true;
|
||||
enableDataCollection = false;
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;};
|
||||
mergetools = import ../../../modules/lib/mergetools.nix {inherit pkgs lib config;};
|
||||
mkMergeIni = mergetools.mkMergedIni;
|
||||
# username = config.home.username;
|
||||
fsearchConf = mkMergeIni {
|
||||
name = "fsearch-conf";
|
||||
target = ".config/fsearch/fsearch.conf";
|
||||
target = "${config.home.homeDirectory}/.config/fsearch/fsearch.conf";
|
||||
settings = {
|
||||
Interface = {
|
||||
single_click_open = false;
|
||||
|
|
|
|||
|
|
@ -22,8 +22,31 @@
|
|||
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 {
|
||||
home.packages = [edit-fzf];
|
||||
home.packages = [edit-fzf ii-fzf];
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
|
|
|
|||
|
|
@ -17,11 +17,13 @@
|
|||
echo "marketplaceID: 12" >> "$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;
|
||||
ciderSpaConfig = mkMergedYaml {
|
||||
name = "cider-spa-config";
|
||||
target = ".config/sh.cider.genten/spa-config.yml";
|
||||
target = "${config.home.homeDirectory}/.config/sh.cider.genten/spa-config.yml";
|
||||
settings = {
|
||||
general = {
|
||||
language = "zh-CN";
|
||||
|
|
@ -35,8 +37,8 @@
|
|||
appearance = "auto";
|
||||
# default: Mojave
|
||||
useAdaptiveColors = true;
|
||||
# TODO: Change to "native" when using simple WM
|
||||
# Electron does not render the three buttons in title bar when "native"
|
||||
# NOTE: "native" breaks window controls on tiling WMs (Electron bug).
|
||||
# "default" works on both GNOME and Niri, so keep it.
|
||||
titleBarStyle = "default";
|
||||
layoutType = "default";
|
||||
fonts = {
|
||||
|
|
@ -81,7 +83,7 @@
|
|||
};
|
||||
in {
|
||||
imports = [
|
||||
../../../modules/home/programs/cider-2.nix
|
||||
./lib.nix
|
||||
ciderSpaConfig
|
||||
];
|
||||
|
||||
|
|
@ -4,11 +4,11 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;};
|
||||
mergetools = import ../../../../modules/lib/mergetools.nix {inherit pkgs lib config;};
|
||||
mkMergeIni = mergetools.mkMergedIni;
|
||||
elisarc = mkMergeIni {
|
||||
name = "elisarc";
|
||||
target = ".config/elisarc";
|
||||
target = "${config.home.homeDirectory}/.config/elisarc";
|
||||
settings = {
|
||||
ElisaFileIndexer = {
|
||||
"RootPath[$e]" = "$HOME/Music";
|
||||
|
|
@ -4,11 +4,11 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;};
|
||||
mergetools = import ../../../../modules/lib/mergetools.nix {inherit pkgs lib config;};
|
||||
mkMergedJson = mergetools.mkMergedJson;
|
||||
feishinConfig = mkMergedJson {
|
||||
name = "feishin-config";
|
||||
target = ".config/feishin/config.json";
|
||||
target = "${config.home.homeDirectory}/.config/feishin/config.json";
|
||||
settings = {
|
||||
theme = "system";
|
||||
window_has_frame = false;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
exit 1
|
||||
}
|
||||
|
||||
# TODO: Add tag search support
|
||||
# DEPRECATED: Consider removing in favour of Obsidian's official CLI.
|
||||
rg --line-number --color=always "" |
|
||||
fzf --ansi \
|
||||
--delimiter : \
|
||||
|
|
@ -4,11 +4,11 @@
|
|||
config,
|
||||
...
|
||||
}: let
|
||||
mergetools = import ../lib/mergetools.nix {inherit pkgs lib config;};
|
||||
mergetools = import ../../../../modules/lib/mergetools.nix {inherit pkgs lib config;};
|
||||
mkMergedJson = mergetools.mkMergedJson;
|
||||
readestSettings = mkMergedJson {
|
||||
name = "readest-settings";
|
||||
target = ".config/com.bilingify.readest/settings.json";
|
||||
target = "${config.home.homeDirectory}/.config/com.bilingify.readest/settings.json";
|
||||
settings = {
|
||||
globalViewSettings = {
|
||||
serifFont = "LXGW WenKai GB Screen";
|
||||
|
|
@ -15,24 +15,24 @@
|
|||
|
||||
# Programs
|
||||
./programs/aichat.nix
|
||||
./programs/firefox
|
||||
./programs/emacs.nix
|
||||
./programs/zed-editor.nix
|
||||
./programs/browsers/firefox
|
||||
./programs/editors/emacs.nix
|
||||
./programs/editors/zed-editor.nix
|
||||
./programs/rime
|
||||
./programs/sdcv.nix
|
||||
./programs/productivity/sdcv.nix
|
||||
./programs/fzf.nix
|
||||
./programs/sops.nix
|
||||
./programs/nvim.nix
|
||||
./programs/editors/nvim.nix
|
||||
./programs/pdf2zh/uv.nix
|
||||
./programs/yazi.nix
|
||||
./programs/edit-clipboard.nix
|
||||
./programs/neovide.nix
|
||||
./programs/ghostty.nix
|
||||
./programs/tmux.nix
|
||||
./programs/kitty.nix
|
||||
./programs/anki.nix
|
||||
./programs/sioyek
|
||||
./programs/telegram.nix
|
||||
./programs/editors/neovide.nix
|
||||
./programs/terminals/ghostty.nix
|
||||
./programs/terminals/tmux.nix
|
||||
./programs/terminals/kitty.nix
|
||||
./programs/productivity/anki.nix
|
||||
./programs/productivity/sioyek
|
||||
./programs/social/telegram.nix
|
||||
# ./programs/retroarch.nix # Package broken on macOS
|
||||
./programs/darwin/duti.nix
|
||||
./programs/darwin/alt-tab.nix
|
||||
|
|
|
|||
|
|
@ -32,19 +32,51 @@ in {
|
|||
./programs/shell/carapace.nix
|
||||
./programs/shell/direnv.nix
|
||||
|
||||
# Personal Program
|
||||
./programs/chromium.nix
|
||||
./programs/firefox
|
||||
./programs/emacs.nix
|
||||
./programs/vscode.nix
|
||||
# Browsers
|
||||
./programs/browsers/chromium.nix
|
||||
./programs/browsers/firefox
|
||||
|
||||
# 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/mime.nix
|
||||
./programs/zed-editor.nix
|
||||
./programs/rime
|
||||
./programs/sdcv.nix
|
||||
./programs/fzf.nix
|
||||
./programs/libreoffice.nix
|
||||
./programs/nvim.nix
|
||||
./programs/ollama.nix
|
||||
./programs/sops.nix
|
||||
./programs/pdf2zh/container.nix
|
||||
|
|
@ -54,34 +86,14 @@ in {
|
|||
./programs/magick.nix
|
||||
./programs/miniserve.nix
|
||||
./programs/retroarch.nix
|
||||
./programs/neovide.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/tmux.nix
|
||||
./programs/kitty.nix
|
||||
./programs/wine.nix
|
||||
./programs/anki.nix
|
||||
./programs/libvirt.nix
|
||||
./programs/block-desktop-entries.nix
|
||||
./programs/pwa.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/elisa.nix
|
||||
./programs/lollypop.nix
|
||||
./programs/gallery-dl.nix
|
||||
./programs/readest.nix
|
||||
# ./programs/openclaw.nix
|
||||
./programs/libmagic.nix
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue