Refactor modules into nixos and home-manager
All checks were successful
Check flake / build-amd64-linux (push) Successful in 3m14s
All checks were successful
Check flake / build-amd64-linux (push) Successful in 3m14s
This commit is contained in:
53
modules/home-manager/shell/zsh/default.nix
Normal file
53
modules/home-manager/shell/zsh/default.nix
Normal file
@ -0,0 +1,53 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let cfg = config.modules.shell.zsh;
|
||||
in {
|
||||
options.modules.shell.zsh = {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
enableGlobalCompInit = false;
|
||||
promptInit = "";
|
||||
};
|
||||
|
||||
user.packages = with pkgs; [
|
||||
fd
|
||||
unstable.fzf
|
||||
jq
|
||||
nix-zsh-completions
|
||||
nnn
|
||||
ripgrep
|
||||
zsh
|
||||
];
|
||||
|
||||
env = {
|
||||
ZDOTDIR = "$XDG_CONFIG_HOME/zsh";
|
||||
ZSH_CACHE = "$XDG_CACHE_HOME/zsh";
|
||||
ZGEN_DIR = "$XDG_DATA_HOME/zgenom";
|
||||
};
|
||||
|
||||
home.configFile = {
|
||||
"zsh/.zshrc".source = ./.zshrc;
|
||||
"zsh/aliases.zsh".source = ./aliases.zsh;
|
||||
"zsh/completion.zsh".source = ./completion.zsh;
|
||||
"zsh/config.zsh".source = ./config.zsh;
|
||||
"zsh/keybinds.zsh".source = ./keybinds.zsh;
|
||||
};
|
||||
|
||||
system.userActivationScripts.cleanupZgen = ''
|
||||
rm -rf $ZDOTDIR/.*.zwc
|
||||
rm -f $ZDOTDIR/.zcompdump
|
||||
rm -rf $ZSH_CACHE
|
||||
rm -fv $ZGEN_DIR/init.zsh{,.zwc}
|
||||
'';
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user