refactor: what can I say

This commit is contained in:
2025-04-19 12:42:19 +08:00
parent d34da2b672
commit 2242e26ede
51 changed files with 211 additions and 332 deletions

15
modules/cli/shell/all.nix Normal file
View File

@@ -0,0 +1,15 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all shells";
optionPath = [
"cli"
"shell"
"all"
];
config' = {
my.cli.shell = {
zsh.enable = true;
};
};
}

View File

@@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./all.nix
./zsh.nix
];
}

49
modules/cli/shell/zsh.nix Normal file
View File

@@ -0,0 +1,49 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
default = true;
optionName = "default zsh settings";
optionPath = [
"cli"
"shell"
"zsh"
];
config' = {
my.home =
let
stateHome = config.my.home.xdg.stateHome;
in
{
home.packages = [ pkgs.omz ];
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
history = {
path = "${stateHome}/zsh_history";
ignorePatterns = [
"la"
];
};
initExtra = ''
source ${pkgs.omz}/share/omz/omz.zsh
'';
sessionVariables = {
_ZL_DATA = "${stateHome}/zlua";
_FZF_HISTORY = "${stateHome}/fzf_history";
};
shellAliases = {
ls = "lsd";
svim = "sudoedit";
nf = "neofetch";
tmux = "tmux -T RGB,focus,overline,mouse,clipboard,usstyle";
pastart = "pasuspender true";
};
};
};
};
}