diff options
author | jjanzen <jjanzen@jjanzen.ca> | 2025-01-08 17:24:21 -0600 |
---|---|---|
committer | jjanzen <jjanzen@jjanzen.ca> | 2025-01-08 17:24:21 -0600 |
commit | a75b69b88f967e6271d75a1bc122da0b2e4eeece (patch) | |
tree | 20b7fb1bec30f68e61846c45a481bee174f4af9f /macos.local/.flake/home/programs | |
parent | a1cbc273fb92c69ea1b8534f6ef6064b5da40e31 (diff) |
system changes
Diffstat (limited to 'macos.local/.flake/home/programs')
-rw-r--r-- | macos.local/.flake/home/programs/core.nix.org | 1 | ||||
-rw-r--r-- | macos.local/.flake/home/programs/ghostty.nix.org | 28 | ||||
-rw-r--r-- | macos.local/.flake/home/programs/ssh.nix.org | 35 | ||||
-rw-r--r-- | macos.local/.flake/home/programs/zsh/core.nix.org | 36 | ||||
-rw-r--r-- | macos.local/.flake/home/programs/zsh/init-extra.sh.org | 28 | ||||
-rw-r--r-- | macos.local/.flake/home/programs/zsh/profile-extra.sh.org | 10 |
6 files changed, 101 insertions, 37 deletions
diff --git a/macos.local/.flake/home/programs/core.nix.org b/macos.local/.flake/home/programs/core.nix.org index 5aa8897..064eddc 100644 --- a/macos.local/.flake/home/programs/core.nix.org +++ b/macos.local/.flake/home/programs/core.nix.org @@ -6,7 +6,6 @@ Import configurations for programs and install programs with no configuration. { imports = [ - ./alacritty.nix ./emacs/core.nix ./fastfetch.nix ./ghostty.nix diff --git a/macos.local/.flake/home/programs/ghostty.nix.org b/macos.local/.flake/home/programs/ghostty.nix.org index ccfdae3..29bc15a 100644 --- a/macos.local/.flake/home/programs/ghostty.nix.org +++ b/macos.local/.flake/home/programs/ghostty.nix.org @@ -1,23 +1,23 @@ -#+title: GhosTTY Configuration +#+title: ghostty Configuration -This terminal emulator seems over-hyped, but I'm trying it anyways. +I use =ghostty= as a terminal emulator on macOS. I disable auto-update and set some sensible options. #+begin_src nix { config, pkgs, ... }: { home.file."./.config/ghostty/config".text = '' - auto-update = "off" - background-blur-radius = 20 - background-opacity = 0.8 - clipboard-trim-trailing-spaces = true - font-family = "SauceCodePro Nerd Font" - font-thicken = true - macos-option-as-alt = true - macos-window-shadow = false - mouse-hide-while-typing = true - quit-after-last-window-closed = true - theme = "Builtin Light" - window-decoration = true + auto-update = "off" + background-blur-radius = 20 + background-opacity = 0.8 + clipboard-trim-trailing-spaces = true + font-family = "SauceCodePro Nerd Font" + font-thicken = true + macos-option-as-alt = true + macos-window-shadow = false + mouse-hide-while-typing = true + quit-after-last-window-closed = true + theme = "Builtin Light" + window-decoration = true ''; } #+end_src diff --git a/macos.local/.flake/home/programs/ssh.nix.org b/macos.local/.flake/home/programs/ssh.nix.org index e1ba2ca..28f779f 100644 --- a/macos.local/.flake/home/programs/ssh.nix.org +++ b/macos.local/.flake/home/programs/ssh.nix.org @@ -1,6 +1,6 @@ #+title: SSH Configuration -Configure SSH. Keys should be added to the SSH agent. Specify the key file and use the system keychain. +Configure SSH. Keys should be added to the SSH agent. Use the system keychain on all configurations. #+begin_src nix { config, pkgs, ... }: { @@ -14,30 +14,21 @@ Configure SSH. Keys should be added to the SSH agent. Specify the key file and u "UseKeychain" = "yes"; }; }; -#+end_src -Here is my University of Manitoba computer science SSH server. My account is =janzenj2=. -#+begin_src nix - "aviary" = { - hostname = "aviary.cs.umanitoba.ca"; - user = "janzenj2"; - setEnv = { - "TERM" = "xterm"; - }; - }; -#+end_src + "aviary" = { + hostname = "aviary.cs.umanitoba.ca"; + user = "janzenj2"; + setEnv = { + "TERM" = "xterm"; + }; + }; -Here is my web server at =jjanzen.ca=. Set the =$TERM= variable to =xterm=. -#+begin_src nix - "jjanzen.ca" = { - setEnv = { - "TERM" = "xterm"; - }; - }; -#+end_src + "jjanzen.ca" = { + setEnv = { + "TERM" = "xterm"; + }; + }; -Here is my oracle cloud instance login. Use the =opc= user and a provided key file. Set the =$TERM= variable to =xterm=. -#+begin_src nix "oracle" = { setEnv = { "TERM" = "xterm"; diff --git a/macos.local/.flake/home/programs/zsh/core.nix.org b/macos.local/.flake/home/programs/zsh/core.nix.org new file mode 100644 index 0000000..84e9aff --- /dev/null +++ b/macos.local/.flake/home/programs/zsh/core.nix.org @@ -0,0 +1,36 @@ +#+title: ZSH Configuration + +Open =zsh= configuration. +#+begin_src nix + { config, pkgs, ... }: + + { + programs.zsh = { + enable = true; + + 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 = builtins.readFile ./init-extra.sh; + + profileExtra = builtins.readFile ./profile-extra.sh; + }; + } +#+end_src diff --git a/macos.local/.flake/home/programs/zsh/init-extra.sh.org b/macos.local/.flake/home/programs/zsh/init-extra.sh.org new file mode 100644 index 0000000..8255ce1 --- /dev/null +++ b/macos.local/.flake/home/programs/zsh/init-extra.sh.org @@ -0,0 +1,28 @@ +#+title: ZSH Extra Initialization Code + +Define optional aliases. +#+begin_src sh + which lesspipe.sh &> /dev/null && export LESSOPEN="|lesspipe.sh %s" + which eza &> /dev/null && alias ls=eza +#+end_src + +Enable =fzf= extensions for =zsh=. +#+begin_src sh + which zsh &> /dev/null && source <(fzf --zsh) +#+end_src + +Enable git status in =zsh= 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 diff --git a/macos.local/.flake/home/programs/zsh/profile-extra.sh.org b/macos.local/.flake/home/programs/zsh/profile-extra.sh.org new file mode 100644 index 0000000..64457ed --- /dev/null +++ b/macos.local/.flake/home/programs/zsh/profile-extra.sh.org @@ -0,0 +1,10 @@ +#+title: Profile Extra Code + +Enable =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 |