Initial commit
This commit is contained in:
9
home/shells/zsh/aliases.nix
Normal file
9
home/shells/zsh/aliases.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
programs.zsh.shellAliases = {
|
||||
v = "nvim";
|
||||
c = "clear";
|
||||
cp = "cp -riv";
|
||||
|
||||
"nix-shell" = "nix-shell --command zsh";
|
||||
};
|
||||
}
|
||||
27
home/shells/zsh/default.nix
Normal file
27
home/shells/zsh/default.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./prompt.nix
|
||||
./aliases.nix
|
||||
./scripts.nix
|
||||
];
|
||||
|
||||
home.sessionVariables."SHELL" = "${lib.getExe pkgs.zsh}";
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
|
||||
autosuggestion.enable = true;
|
||||
enableCompletion = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
initContent = ''
|
||||
bindkey -e
|
||||
|
||||
export SHELL="${lib.getExe pkgs.zsh}"
|
||||
'';
|
||||
};
|
||||
}
|
||||
8
home/shells/zsh/prompt.nix
Normal file
8
home/shells/zsh/prompt.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
programs.oh-my-posh = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
|
||||
settings = builtins.fromTOML (builtins.readFile ./theme.omp.toml);
|
||||
};
|
||||
}
|
||||
33
home/shells/zsh/scripts.nix
Normal file
33
home/shells/zsh/scripts.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
pkgs,
|
||||
dotsDir,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
(writeScriptBin "rebuild" ''
|
||||
cd ${dotsDir}
|
||||
git add -A 2>/dev/null
|
||||
sudo nixos-rebuild $@ switch --flake .
|
||||
cd - >/dev/null
|
||||
'')
|
||||
|
||||
(writeScriptBin "update" ''
|
||||
cd ${dotsDir}
|
||||
git add -A 2>/dev/null
|
||||
sudo nix flake $@ update
|
||||
cd - >/dev/null
|
||||
'')
|
||||
|
||||
(writeScriptBin "nix" ''
|
||||
NIX=${pkgs.lib.getExe pkgs.nix}
|
||||
|
||||
if [[ $1 == "develop" || $1 == "shell" ]]; then
|
||||
cmd=$1
|
||||
shift
|
||||
exec "$NIX" "$cmd" -c "$SHELL" "$@"
|
||||
else
|
||||
exec "$NIX" "$@"
|
||||
fi
|
||||
'')
|
||||
];
|
||||
}
|
||||
72
home/shells/zsh/theme.omp.toml
Normal file
72
home/shells/zsh/theme.omp.toml
Normal file
@@ -0,0 +1,72 @@
|
||||
version = 3
|
||||
final_space = true
|
||||
|
||||
[transient_prompt]
|
||||
template = ' '
|
||||
foreground = '#f9e2af'
|
||||
background = 'transparent'
|
||||
|
||||
[[blocks]]
|
||||
type = 'prompt'
|
||||
alignment = 'left'
|
||||
newline = true
|
||||
|
||||
[[blocks.segments]]
|
||||
template = '{{ if .Root }}root{{ else }}{{ .UserName }}{{ end }}@{{ .HostName }} '
|
||||
foreground = '#cba6f7'
|
||||
type = 'session'
|
||||
style = 'plain'
|
||||
|
||||
[blocks.segments.properties]
|
||||
cache_duration = 'none'
|
||||
|
||||
[[blocks.segments]]
|
||||
template = '{{ if ne .Type "unknown" }} {{ end }}'
|
||||
foreground = '#89b4fa'
|
||||
type = 'nix-shell'
|
||||
style = 'plain'
|
||||
|
||||
[blocks.segments.properties]
|
||||
cache_duration = 'none'
|
||||
|
||||
[[blocks.segments]]
|
||||
template = 'in'
|
||||
foreground = '#585b70'
|
||||
type = 'text'
|
||||
style = 'plain'
|
||||
|
||||
[blocks.segments.properties]
|
||||
cache_duration = 'none'
|
||||
|
||||
[[blocks.segments]]
|
||||
foreground = '#89dceb'
|
||||
type = 'path'
|
||||
style = 'powerline'
|
||||
|
||||
[blocks.segments.properties]
|
||||
cache_duration = 'none'
|
||||
style = 'full'
|
||||
|
||||
[[blocks.segments]]
|
||||
template = '{{if .UpstreamIcon}}{{ .UpstreamIcon }} {{end}}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} {{ .StashCount }}{{ end }}'
|
||||
foreground = '#585b70'
|
||||
type = 'git'
|
||||
style = 'plain'
|
||||
|
||||
[blocks.segments.properties]
|
||||
fetch_upstream_icon = true
|
||||
fetch_status = true
|
||||
|
||||
[[blocks]]
|
||||
type = 'prompt'
|
||||
alignment = 'left'
|
||||
newline = true
|
||||
|
||||
[[blocks.segments]]
|
||||
template = ''
|
||||
foreground = '#f9e2af'
|
||||
type = 'text'
|
||||
style = 'plain'
|
||||
|
||||
[blocks.segments.properties]
|
||||
cache_duration = 'none'
|
||||
Reference in New Issue
Block a user