modularize zsh args and add eslint_d alias

This commit is contained in:
sadan 2025-03-11 20:10:10 -04:00
parent de910497fa
commit 4989c750ad
No known key found for this signature in database
2 changed files with 33 additions and 25 deletions

View file

@ -1,15 +1,28 @@
{ pkgs, ... }: { { pkgs, ... }:
let
node = pkgs.nodejs_22;
in
{
imports = [ imports = [
../prisma.nix ../prisma.nix
../../../../customPackages ../../../../customPackages
../unstable.nix ../unstable.nix
]; ];
programs = {
zsh = {
initExtra = ''
eval "$(${node}/bin/node --completion-bash)"
'';
};
};
home = { home = {
shellAliases = { shellAliases = {
pd = "/home/meyer/dev/ts/pnpm/pnpm/dev/pd.js"; pd = "/home/meyer/dev/ts/pnpm/pnpm/dev/pd.js";
webpack = "webpack-cli"; webpack = "webpack-cli";
eslintd = "eslint_d";
}; };
packages = with pkgs; packages =
with pkgs;
[ [
cpkg.chrome-pak-customizer cpkg.chrome-pak-customizer
lemminx lemminx
@ -20,11 +33,12 @@
typescript typescript
unstable.eslint unstable.eslint
unstable.corepack_23 unstable.corepack_23
nodejs_22 node
vsce vsce
esbuild esbuild
unstable.pnpm unstable.pnpm
] ++ (with pkgs.nodePackages; [ ]
++ (with pkgs.nodePackages; [
webpack-cli webpack-cli
nodemon nodemon
ts-node ts-node

View file

@ -1,16 +1,4 @@
{ lib, pkgs, ... }: { pkgs, ... }:
let
# TODO: make these modular
_ = [
"source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme"
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
"eval \"$(${pkgs.nh}/bin/nh completions --shell=zsh)\""
"eval \"$(${pkgs.nodejs_22}/bin/node --completion-bash)\""
"[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh"
"setopt globstarshort"
];
zshInitArgs = lib.concatMapStrings (x: x + "\n") _;
in
{ {
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
@ -19,7 +7,7 @@ in
zsh-syntax-highlighting zsh-syntax-highlighting
]; ];
sessionVariables = { sessionVariables = {
POWERSHELL_PATH = "${pkgs.powershell}/bin/pwsh"; POWERSHELL_PATH = "${pkgs.powershell}/bin/pwsh";
}; };
file = { file = {
p10k = { p10k = {
@ -31,11 +19,11 @@ in
}; };
programs = { programs = {
direnv = { direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv = {
enable = true; enable = true;
enableZshIntegration = true; };
nix-direnv = {
enable = true;
};
}; };
zoxide = { zoxide = {
enable = true; enable = true;
@ -44,7 +32,13 @@ in
zsh = { zsh = {
enable = true; enable = true;
oh-my-zsh.enable = true; oh-my-zsh.enable = true;
initExtra = zshInitArgs; initExtra = ''
source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
eval "$(${pkgs.nh}/bin/nh completions --shell=zsh)"
setopt globstarshort
'';
enableCompletion = true; enableCompletion = true;
plugins = [ plugins = [
{ {