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 | |
parent | a1cbc273fb92c69ea1b8534f6ef6064b5da40e31 (diff) |
system changes
19 files changed, 206 insertions, 256 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 diff --git a/macos.local/.flake/home/core.nix.org b/macos.local/.flake/home/core.nix.org index 4801831..f92adc3 100644 --- a/macos.local/.flake/home/core.nix.org +++ b/macos.local/.flake/home/core.nix.org @@ -1,6 +1,6 @@ #+title: Home Configuration -Set up home manager for my user account and import submodules. +Set up home manager for my user account and import submodules. Define my user as =jjanzen= and specify the wallpaper and add items to the =PATH= variable. #+begin_src nix { config, pkgs, ... }: @@ -14,21 +14,12 @@ Set up home manager for my user account and import submodules. home.stateVersion = "24.05"; programs.home-manager.enable = true; -#+end_src -Set username and paths. -#+begin_src nix home.username = "jjanzen"; home.homeDirectory = "/Users/jjanzen"; -#+end_src -Import a wallpaper to the path =~/.wallpaper=. -#+begin_src nix home.file.".wallpaper".source = ./.wallpaper; -#+end_src -Add Homebrew to the path along with standard =bin= directories. -#+begin_src nix home.sessionPath = [ "$HOME/.local/bin" "/usr/local/bin" 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 diff --git a/macos.local/.flake/home/scripts/core.nix.org b/macos.local/.flake/home/scripts/core.nix.org index 53f05db..bf5f685 100644 --- a/macos.local/.flake/home/scripts/core.nix.org +++ b/macos.local/.flake/home/scripts/core.nix.org @@ -5,10 +5,19 @@ Import various scripts useful on my system. { config, pkgs, ... }: { - imports = [ - ./deploy-website.nix - ./launcher.nix - ./remove-quarantine.nix - ]; + home.file = { + "./.local/bin/deploy-website" = { + executable = true; + source = ./deploy-website; + }; + "./local/bin/launcher" = { + executable = true; + source = ./launcher; + }; + "./local/bin/remove-quarantine" = { + executable = true; + source = ./remove-quarantine; + }; + }; } #+end_src diff --git a/macos.local/.flake/home/scripts/deploy-website.nix.org b/macos.local/.flake/home/scripts/deploy-website.nix.org deleted file mode 100644 index f1d1d10..0000000 --- a/macos.local/.flake/home/scripts/deploy-website.nix.org +++ /dev/null @@ -1,25 +0,0 @@ -#+title: Website Deploy Script - -Deploy my website from a specified branch. -#+begin_src nix - { config, pkgs, ... }: - - { - home.file."./.local/bin/deploy-website" = { - executable = true; - text = '' -#+end_src - -=ssh= into my server and run the deploy script, passing command line arguments to the script. -#+begin_src sh - #!/bin/sh - /usr/bin/ssh jjanzen.ca "sudo /usr/local/bin/deploy.sh "$@"" -#+end_src - - -Close the block. -#+begin_src nix - ''; - }; - } -#+end_src diff --git a/macos.local/.flake/home/scripts/deploy-website.org b/macos.local/.flake/home/scripts/deploy-website.org new file mode 100644 index 0000000..76e5d54 --- /dev/null +++ b/macos.local/.flake/home/scripts/deploy-website.org @@ -0,0 +1,7 @@ +#+title: Website Deploy Script + +Deploy my website from a specified branch by using =ssh= to get into my server and running the deploy script, passing command line arguments to the script. +#+begin_src sh + #!/bin/sh + /usr/bin/ssh jjanzen.ca "sudo /usr/local/bin/deploy.sh "$@"" +#+end_src diff --git a/macos.local/.flake/home/scripts/launcher.nix.org b/macos.local/.flake/home/scripts/launcher.nix.org deleted file mode 100644 index b9debc7..0000000 --- a/macos.local/.flake/home/scripts/launcher.nix.org +++ /dev/null @@ -1,26 +0,0 @@ -#+title: Launcher Script - -Use =choose-gui= to launch an application. This is used for an =skhd= keyboard command to launch applications. -#+begin_src nix - { config, pkgs, ... }: - - { - home.file."./.local/bin/launcher" = { - executable = true; - text = '' -#+end_src - -Find an app with =choose-gui= and open it. -#+begin_src sh - #!/bin/sh - app="$(ls /Applications/ /Applications/Utilities/ /System/Applications/ /System/Applications/Utilities/ ~/Applications/ | grep '\.app$' | sed 's/\.app$//g' | choose -f "SauceCodePro Nerd Font" -s 15 -b ece0c9).app" - - open -n "$HOME/Applications/$app" || open -n "/Applications/$app" || open -n "/System/Applications/Utilities/$app" || open -n "/System/Applications/$app" || open -n "/Applications/Utilities/$app" -#+end_src - -Close the block. -#+begin_src nix - ''; - }; - } -#+end_src diff --git a/macos.local/.flake/home/scripts/launcher.org b/macos.local/.flake/home/scripts/launcher.org new file mode 100644 index 0000000..3ef221d --- /dev/null +++ b/macos.local/.flake/home/scripts/launcher.org @@ -0,0 +1,9 @@ +#+title: Launcher Script + +Use =choose-gui= to launch an application. This is used for a keyboard command to launch applications. +#+begin_src sh + #!/bin/sh + app="$(ls /Applications/ /Applications/Utilities/ /System/Applications/ /System/Applications/Utilities/ ~/Applications/ | grep '\.app$' | sed 's/\.app$//g' | choose -f "SauceCodePro Nerd Font" -s 15 -b ece0c9).app" + + open -n "$HOME/Applications/$app" || open -n "/Applications/$app" || open -n "/System/Applications/Utilities/$app" || open -n "/System/Applications/$app" || open -n "/Applications/Utilities/$app" +#+end_src diff --git a/macos.local/.flake/home/scripts/remove-quarantine.nix.org b/macos.local/.flake/home/scripts/remove-quarantine.nix.org deleted file mode 100644 index fa8d882..0000000 --- a/macos.local/.flake/home/scripts/remove-quarantine.nix.org +++ /dev/null @@ -1,24 +0,0 @@ -#+title: Remove Quarantine - -macOS likes putting applications in quarantine without me wanting. This script removes an application from the quarantine. -#+begin_src nix - { config, pkgs, ... }: - - { - home.file."./.local/bin/remove-quarantine" = { - executable = true; - text = '' -#+end_src - -Remove the app from quarantine by recursively deleting the quarantine attribute on the application. -#+begin_src sh - #!/bin/sh - /usr/bin/xattr -dr com.apple.quarantine "$@" -#+end_src - -Close the block. -#+begin_src nix - ''; - }; - } -#+end_src diff --git a/macos.local/.flake/home/scripts/remove-quarantine.org b/macos.local/.flake/home/scripts/remove-quarantine.org new file mode 100644 index 0000000..373c503 --- /dev/null +++ b/macos.local/.flake/home/scripts/remove-quarantine.org @@ -0,0 +1,7 @@ +#+title: Remove Quarantine + +macOS likes putting applications in quarantine without me wanting. This script removes an application from the quarantine. Remove the app from quarantine by recursively deleting the quarantine attribute on the application. +#+begin_src sh + #!/bin/sh + /usr/bin/xattr -dr com.apple.quarantine "$@" +#+end_src diff --git a/macos.local/.flake/system/aerospace.nix.org b/macos.local/.flake/system/aerospace.nix.org index bc7e11f..2ec5604 100644 --- a/macos.local/.flake/system/aerospace.nix.org +++ b/macos.local/.flake/system/aerospace.nix.org @@ -1,5 +1,6 @@ #+title: Aerospace Configuration +Enable Aerospace as a window manager for macOS. I have disabled gaps, move the mouse to follow windows, and an =i3=-like binding configuration. #+begin_src nix { config, pkgs, ... }: diff --git a/macos.local/.flake/system/homebrew.nix.org b/macos.local/.flake/system/homebrew.nix.org index 8e0419c..4ea5bc0 100644 --- a/macos.local/.flake/system/homebrew.nix.org +++ b/macos.local/.flake/system/homebrew.nix.org @@ -1,6 +1,6 @@ #+title: Homebrew Configuration -Set up Homebrew. +Set up Homebrew. I disable the quarantine automatically and ensure that the state of Homebrew is exactly as specified here. #+begin_src nix { config, pkgs, ... }: |