Worked on zsh + starship + confs
This commit is contained in:
+8
-32
@@ -1144,13 +1144,13 @@ This file sets up starship prompt
|
||||
** =generated/system/applications/terminal_shell/zsh.nix=
|
||||
This is top file of this level which contains just an import statement for all relevant files and/or the subfolder in this folder
|
||||
#+BEGIN_SRC nix :tangle generated/system/applications/terminal_shell/zsh.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ config, pkgs, lib, user, ... }:
|
||||
{ config, pkgs, lib, user, flakeRoot, ... }:
|
||||
let
|
||||
zshConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/zsh";
|
||||
assetsDir = "${flakeRoot}/assets/common/conf/zsh";
|
||||
in
|
||||
{
|
||||
home-manager.users.${user.username} = {
|
||||
# Install zsh-syntax-highlighting
|
||||
home.packages = with pkgs; [
|
||||
zsh-syntax-highlighting
|
||||
starship
|
||||
@@ -1179,37 +1179,13 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
# Consolidated .zshrc
|
||||
xdg.configFile."zsh/.zshrc".text = lib.concatStringsSep "\n" [
|
||||
"# Oh-My-Zsh"
|
||||
"export ZSH=\"${zshConfigDir}\""
|
||||
"source \"${pkgs.zsh}/share/zsh/functions/Newuser/zsh-newuser-install\""
|
||||
"source \"${zshConfigDir}/oh-my-zsh.sh\""
|
||||
""
|
||||
"# Zsh options"
|
||||
"setopt AUTO_CD"
|
||||
"setopt CORRECT"
|
||||
"setopt INTERACTIVE_COMMENTS"
|
||||
""
|
||||
"# zsh-syntax-highlighting (manually sourced)"
|
||||
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
""
|
||||
"# Starship"
|
||||
"eval \"$(starship init zsh)\""
|
||||
""
|
||||
"# fzf"
|
||||
"source \"${pkgs.fzf}/shell/key-bindings.zsh\""
|
||||
"source \"${pkgs.fzf}/shell/completion.zsh\""
|
||||
""
|
||||
"# User customizations"
|
||||
"source \"${zshConfigDir}/custom.zsh\" 2>/dev/null"
|
||||
];
|
||||
# Use the .zshrc file from assets
|
||||
xdg.configFile."zsh/.zshrc".source = "${assetsDir}/.zshrc";
|
||||
|
||||
# User customizations
|
||||
xdg.configFile."zsh/custom.zsh".text = ''
|
||||
export EDITOR="nvim"
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
'';
|
||||
# Create symlinks or copy files from assets to XDG config
|
||||
xdg.configFile."zsh/custom.zsh".source = "${assetsDir}/custom.zsh";
|
||||
xdg.configFile."zsh/aliases.zsh".source = "${assetsDir}/aliases.zsh";
|
||||
xdg.configFile."zsh/history.zsh".source = "${assetsDir}/history.zsh";
|
||||
};
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
Reference in New Issue
Block a user