diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/.flake/home/clang-format.nix.org | 2 | ||||
-rw-r--r-- | common/.flake/home/programs/fastfetch.nix.org | 45 | ||||
-rw-r--r-- | common/.flake/home/programs/zsh.nix.org | 146 |
3 files changed, 65 insertions, 128 deletions
diff --git a/common/.flake/home/clang-format.nix.org b/common/.flake/home/clang-format.nix.org index f25e482..1a31310 100644 --- a/common/.flake/home/clang-format.nix.org +++ b/common/.flake/home/clang-format.nix.org @@ -6,7 +6,7 @@ Set global =clang-format= options: - Use Linux standards for braces (new line for functions, same line for everything else) - If statements cannot be on a single line. - Case labels are not indented. -#+begin_src nix :tangle ~/.flake/home/clang-format.nix :mkdirp yes +#+begin_src nix { config, pkgs, ... }: { diff --git a/common/.flake/home/programs/fastfetch.nix.org b/common/.flake/home/programs/fastfetch.nix.org index acdbd16..4ab4a25 100644 --- a/common/.flake/home/programs/fastfetch.nix.org +++ b/common/.flake/home/programs/fastfetch.nix.org @@ -1,33 +1,6 @@ #+title: Fastfetch Configuration -Specify the layout for =fastfetch=. -#+begin_src nix - { config, pkgs, ... }: - - { - programs.fastfetch = { - enable = true; - settings = { -#+end_src - -Use a =sixel=-encoded logo at =~/.config/fastfetch/logo.sixel=. -#+begin_src nix - logo = { - type = "raw"; - source = "~/.config/fastfetch/logo.sixel"; - width = 40; - height = 19; - }; -#+end_src - -Use two spaces as a separator. -#+begin_src nix - display = { - separator = " "; - }; -#+end_src - -List out +Specify the layout for =fastfetch=. List out - Operating system - The kernel - Uptime @@ -42,7 +15,23 @@ List out - Disk usage - Locale - Colours + #+begin_src nix + { config, pkgs, ... }: + + { + programs.fastfetch = { + enable = true; + settings = { + logo = { + type = "raw"; + source = "~/.config/fastfetch/logo.sixel"; + width = 40; + height = 19; + }; + display = { + separator = " "; + }; modules = [ "title" { diff --git a/common/.flake/home/programs/zsh.nix.org b/common/.flake/home/programs/zsh.nix.org index 6b8d5ea..1d3a4be 100644 --- a/common/.flake/home/programs/zsh.nix.org +++ b/common/.flake/home/programs/zsh.nix.org @@ -7,106 +7,54 @@ Open =zsh= configuration. { programs.zsh = { enable = true; -#+end_src - -Automatically =cd= if only the path is used. -#+begin_src nix - autocd = true; -#+end_src -Enable auto-suggestions. -#+begin_src nix - autosuggestion = { - enable = true; - }; -#+end_src - -Use =vi= keybindings. -#+begin_src nix - defaultKeymap = "emacs"; -#+end_src - -Append to the history and ignore duplicates. -#+begin_src nix - history = { - append = true; - ignoreAllDups = true; - }; -#+end_src - -Specify =ls= aliases. -#+begin_src nix - shellAliases = { - "ll" = "ls -alF"; - "la" = "ls -a"; - "l" = "ls -F"; - "sl" = "ls"; - }; -#+end_src - -Enable syntax highlighting. -#+begin_src nix - syntaxHighlighting.enable = true; -#+end_src - -Load extra code. -#+begin_src nix - initExtra = '' -#+end_src - -Create potential aliases and create the prompt. -#+begin_src sh - which lesspipe.sh &> /dev/null && export LESSOPEN="|lesspipe.sh %s" - which eza &> /dev/null && alias ls=eza -#+end_src - -Set up fuzzy finder. -#+begin_src sh - which zsh &> /dev/null && source <(fzf --zsh) -#+end_src - -Create the prompt. -#+begin_src sh - parse_git_dirty() { - git_status="$(git status 2> /dev/null)" - [[ "$git_status" =~ "use \"git push\" to publish your local commits" ]] && echo -n " %F{green}%f" - [[ "$git_status" =~ "Changes to be committed:" ]] && echo -n " %F{magenta}%f" - [[ "$git_status" =~ "Changes not staged for commit:" ]] && echo -n " %F{yellow}%f" - [[ "$git_status" =~ "Untracked files:" ]] && echo -n " %F{red}%f" - } - setopt prompt_subst - autoload -Uz vcs_info - precmd () { vcs_info } - zstyle ':vcs_info:*' formats ' %F{blue}%b%f' # git(main) - PS1='%(?..%B%F{red}[%?%\]%f%b )%F{green}%20<...<%~%<<%f$vcs_info_msg_0_$(parse_git_dirty) $ ' -#+end_src - -Close the extra code block. -#+begin_src nix - ''; -#+end_src - -Load =.profile= code. -#+begin_src nix - profileExtra = '' -#+end_src - -Launch =ssh-agent= at login. -#+begin_src sh - if [ ! -S ~/.ssh/ssh_auth_sock ]; then - eval `ssh-agent` > /dev/null - ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock - fi - export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock -#+end_src - -Close =.profile= code. -#+begin_src nix - ''; -#+end_src - -Close =zsh= configuration. -#+begin_src nix + autocd = true; + + autosuggestion.enable = true; + + defaultKeymap = "emacs"; + + history = { + append = true; + ignoreAllDups = true; + }; + + shellAliases = { + "ll" = "ls -alF"; + "la" = "ls -a"; + "l" = "ls -F"; + "sl" = "ls"; + }; + + syntaxHighlighting.enable = true; + + initExtra = '' + which lesspipe.sh &> /dev/null && export LESSOPEN="|lesspipe.sh %s" + which eza &> /dev/null && alias ls=eza + + which zsh &> /dev/null && source <(fzf --zsh) + + parse_git_dirty() { + git_status="$(git status 2> /dev/null)" + [[ "$git_status" =~ "use \"git push\" to publish your local commits" ]] && echo -n " %F{green}%f" + [[ "$git_status" =~ "Changes to be committed:" ]] && echo -n " %F{magenta}%f" + [[ "$git_status" =~ "Changes not staged for commit:" ]] && echo -n " %F{yellow}%f" + [[ "$git_status" =~ "Untracked files:" ]] && echo -n " %F{red}%f" + } + setopt prompt_subst + autoload -Uz vcs_info + precmd () { vcs_info } + zstyle ':vcs_info:*' formats ' %F{blue}%b%f' # git(main) + PS1='%(?..%B%F{red}[%?%\]%f%b )%F{green}%20<...<%~%<<%f$vcs_info_msg_0_$(parse_git_dirty) $ ' + ''; + + profileExtra = '' + if [ ! -S ~/.ssh/ssh_auth_sock ]; then + eval `ssh-agent` > /dev/null + ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock + fi + export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock + ''; }; } #+end_src |