Consolidate shell related packages

This commit is contained in:
2023-01-02 23:35:14 +00:00
parent 201a751382
commit 71b5eee6ed
6 changed files with 26 additions and 57 deletions

View File

@ -36,9 +36,7 @@ with lib.my;
pass.enable = true;
};
shell = {
fzf.enable = true;
git.enable = true;
nnn.enable = true;
zsh.enable = true;
};
};

View File

@ -7,9 +7,7 @@
./editors/vscode.nix
./security/gpg.nix
./security/pass.nix
./shell/fzf.nix
./shell/git.nix
./shell/nnn.nix
./shell/zsh.nix
];
}

View File

@ -65,5 +65,9 @@ with lib.my;
users.users.${config.user.name} = mkAliasDefinitions options.user;
nixpkgs.config.allowUnfree = true;
environment.extraInit =
concatStringsSep "\n"
(mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.env);
};
}

View File

@ -1,21 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.shell.fzf;
in {
options.modules.shell.fzf = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
bind
];
home.programs.fzf = {
enable = true;
enableZshIntegration = true;
defaultCommand = "fd --type f --hidden --follow --exclude .git";
};
};
}

View File

@ -1,16 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.shell.nnn;
in {
options.modules.shell.nnn = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
home.programs.nnn = {
enable = true;
};
};
}

View File

@ -9,27 +9,33 @@ in {
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
users.defaultUserShell = pkgs.zsh;
programs.zsh = {
enable = true;
enableCompletion = true;
};
user.packages = with pkgs; [
fd
fzf
jq
nix-zsh-completions
nnn
ripgrep
zsh
zsh-autosuggestions
zsh-fast-syntax-highlighting
zsh-history-substring-search
];
home.programs.zsh = {
enable = true;
enableCompletion = true;
shellAliases = {
cp = "cp -iv";
mv = "mv -iv";
rm = "rm -v";
mkdir = "mkdir -v";
ls = "ls -h --color=auto --group-directories-first";
e = "nvim";
f = "nnn";
g = "git";
n = "nnn";
v = "nvim";
};
env = {
ZDOTDIR = "$XDG_CONFIG_HOME/zsh";
ZSH_CACHE = "$XDG_CACHE_HOME/zsh";
};
home.configFile = {
"zsh" = {};
};
};
}