aboutsummaryrefslogtreecommitdiff
path: root/macos.local
diff options
context:
space:
mode:
authorjjanzen <jjanzen@jjanzen.ca>2025-01-08 17:24:21 -0600
committerjjanzen <jjanzen@jjanzen.ca>2025-01-08 17:24:21 -0600
commita75b69b88f967e6271d75a1bc122da0b2e4eeece (patch)
tree20b7fb1bec30f68e61846c45a481bee174f4af9f /macos.local
parenta1cbc273fb92c69ea1b8534f6ef6064b5da40e31 (diff)
system changes
Diffstat (limited to 'macos.local')
-rw-r--r--macos.local/.flake/home/core.nix.org11
-rw-r--r--macos.local/.flake/home/programs/core.nix.org1
-rw-r--r--macos.local/.flake/home/programs/ghostty.nix.org28
-rw-r--r--macos.local/.flake/home/programs/ssh.nix.org35
-rw-r--r--macos.local/.flake/home/programs/zsh/core.nix.org36
-rw-r--r--macos.local/.flake/home/programs/zsh/init-extra.sh.org28
-rw-r--r--macos.local/.flake/home/programs/zsh/profile-extra.sh.org10
-rw-r--r--macos.local/.flake/home/scripts/core.nix.org19
-rw-r--r--macos.local/.flake/home/scripts/deploy-website.nix.org25
-rw-r--r--macos.local/.flake/home/scripts/deploy-website.org7
-rw-r--r--macos.local/.flake/home/scripts/launcher.nix.org26
-rw-r--r--macos.local/.flake/home/scripts/launcher.org9
-rw-r--r--macos.local/.flake/home/scripts/remove-quarantine.nix.org24
-rw-r--r--macos.local/.flake/home/scripts/remove-quarantine.org7
-rw-r--r--macos.local/.flake/system/aerospace.nix.org1
-rw-r--r--macos.local/.flake/system/homebrew.nix.org2
16 files changed, 141 insertions, 128 deletions
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, ... }: