diff options
author | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-12-16 23:28:56 -0600 |
---|---|---|
committer | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-12-16 23:28:56 -0600 |
commit | 26dd014860c0edd89a859d2d8c6dff10275acbad (patch) | |
tree | be704eafeb9458cf202240dc0108f13501ae4272 | |
parent | 530ee85037375106652e51a23cf05deb2a5ad1d9 (diff) |
system changes
21 files changed, 560 insertions, 291 deletions
diff --git a/common/.flake/home/clang-format.nix.org b/common/.flake/home/clang-format.nix.org index 64a2a64..f25e482 100644 --- a/common/.flake/home/clang-format.nix.org +++ b/common/.flake/home/clang-format.nix.org @@ -1,5 +1,11 @@ #+title: Clang Format Default Options +Set global =clang-format= options: +- Default to LLVM style +- Use indents of width 4 +- 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 { config, pkgs, ... }: diff --git a/common/.flake/home/fonts.nix.org b/common/.flake/home/fonts.nix.org index ebc1395..5b66799 100644 --- a/common/.flake/home/fonts.nix.org +++ b/common/.flake/home/fonts.nix.org @@ -1,6 +1,8 @@ #+title: Font Configuration -Install fonts necessary for my configuration. +Install fonts necessary for my configuration. Namely +- Computer Modern +- Source Code Pro (Nerd Font) #+begin_src nix :tangle ~/.flake/home/fonts.nix :mkdirp yes { config, pkgs, ... }: diff --git a/common/.flake/home/programs/alacritty.nix.org b/common/.flake/home/programs/alacritty.nix.org index 0c85e2b..5249145 100644 --- a/common/.flake/home/programs/alacritty.nix.org +++ b/common/.flake/home/programs/alacritty.nix.org @@ -1,5 +1,6 @@ #+title: Alacritty Configuration +This is the configuration for Alacritty terminal emulator. #+begin_src nix { config, pkgs, ... }: @@ -7,6 +8,10 @@ programs.alacritty = { enable = true; settings = { +#+end_src + +Use no window decorations, slight transparency, small padding, and allow the =⌥= to work as =alt=. +#+begin_src nix window = { decorations = "None"; opacity = 0.9; @@ -16,6 +21,10 @@ }; option_as_alt = "Both"; }; +#+end_src + +Use Source Code Pro (Nerd Font), size 14 as my font. +#+begin_src nix font = { normal = { family = "SauceCodePro Nerd Font"; @@ -23,6 +32,10 @@ }; size = 14; }; +#+end_src + +Set colour scheme. +#+begin_src nix colors = { primary = { background = "#ece0c9"; diff --git a/common/.flake/home/programs/fastfetch.nix.org b/common/.flake/home/programs/fastfetch.nix.org index 96b2044..acdbd16 100644 --- a/common/.flake/home/programs/fastfetch.nix.org +++ b/common/.flake/home/programs/fastfetch.nix.org @@ -1,22 +1,48 @@ #+title: Fastfetch Configuration Specify the layout for =fastfetch=. -#+begin_src nix :tangle ~/.flake/home/programs/fastfetch.nix :mkdirp yes +#+begin_src nix { config, pkgs, ... }: { programs.fastfetch = { enable = true; settings = { - logo = { - type = "raw"; - source = "~/.config/fastfetch/logo.sixel"; - width = 40; - height = 19; - }; - display = { - separator = " "; - }; +#+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 +- Operating system +- The kernel +- Uptime +- The number of packages +- Shell +- Display information +- Window manager +- Terminal +- CPU information +- GPU information +- Memory information +- Disk usage +- Locale +- Colours +#+begin_src nix modules = [ "title" { diff --git a/common/.flake/home/programs/neovim.nix.org b/common/.flake/home/programs/neovim.nix.org index b67e7b6..586e620 100644 --- a/common/.flake/home/programs/neovim.nix.org +++ b/common/.flake/home/programs/neovim.nix.org @@ -1,6 +1,6 @@ #+title: Neovim Settings -Create a simple Neovim configuration. +Create a simple Neovim configuration. Install some basic packages and use a light colour scheme. #+begin_src nix { config, pkgs, ... }: diff --git a/common/.flake/home/programs/zsh.nix.org b/common/.flake/home/programs/zsh.nix.org index 404586c..6b8d5ea 100644 --- a/common/.flake/home/programs/zsh.nix.org +++ b/common/.flake/home/programs/zsh.nix.org @@ -81,6 +81,7 @@ Create the prompt. 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 @@ -104,7 +105,6 @@ Close =.profile= code. ''; #+end_src - Close =zsh= configuration. #+begin_src nix }; diff --git a/common/.flake/system/skhd.nix.org b/common/.flake/system/skhd.nix.org deleted file mode 100644 index 5b9d2e9..0000000 --- a/common/.flake/system/skhd.nix.org +++ /dev/null @@ -1,48 +0,0 @@ -#+title: SKHD Configuration - -#+begin_src nix - { config, pkgs, ... }: - - { - services.skhd = { - enable = true; - skhdConfig = '' - cmd - return : /opt/homebrew/bin/alacritty - cmd + shift - q : yabai -m window --close - cmd - d : ~/.local/bin/launcher - cmd + shift - c : yabai --restart-service && skhd --restart-service - cmd - h : yabai -m window --focus west || yabai -m display --focus west - cmd - j : yabai -m window --focus south || yabai -m display --focus south - cmd - k : yabai -m window --focus north || yabai -m display --focus north - cmd - l : yabai -m window --focus east || yabai -m display --focus east - shift + cmd - h : yabai -m window --warp west - shift + cmd - j : yabai -m window --warp south - shift + cmd - k : yabai -m window --warp north - shift + cmd - l : yabai -m window --warp east - cmd - 1 : yabai -m space --focus 1 - cmd - 2 : yabai -m space --focus 2 - cmd - 3 : yabai -m space --focus 3 - cmd - 4 : yabai -m space --focus 4 - cmd - 5 : yabai -m space --focus 5 - cmd - 6 : yabai -m space --focus 6 - cmd - 7 : yabai -m space --focus 7 - cmd - 8 : yabai -m space --focus 8 - cmd - 9 : yabai -m space --focus 9 - cmd - 0 : yabai -m space --focus 10 - cmd + shift - 1 : yabai -m window --space 1 - cmd + shift - 2 : yabai -m window --space 2 - cmd + shift - 3 : yabai -m window --space 3 - cmd + shift - 4 : yabai -m window --space 4 - cmd + shift - 5 : yabai -m window --space 5 - cmd + shift - 6 : yabai -m window --space 6 - cmd + shift - 7 : yabai -m window --space 7 - cmd + shift - 8 : yabai -m window --space 8 - cmd + shift - 9 : yabai -m window --space 9 - cmd + shift - 0 : yabai -m window --space 10 - cmd + shift - f : yabai -m window --toggle zoom-fullscreen - cmd + shift - space : yabai -m window --toggle float - cmd + shift - s : open /System/Applications/Utilities/Screenshot.app - ''; - }; - } -#+end_src diff --git a/common/.flake/system/yabai.nix.org b/common/.flake/system/yabai.nix.org deleted file mode 100644 index 8409cd8..0000000 --- a/common/.flake/system/yabai.nix.org +++ /dev/null @@ -1,33 +0,0 @@ -#+title: Yabai Configuration - -#+begin_src nix - { config, pkgs, ... }: - - { - services.yabai = { - enable = true; - enableScriptingAddition = true; - config = { - layout = "bsp"; - auto_balance = "on"; - top_padding = 0; - bottom_padding = 0; - left_padding = 0; - right_padding = 0; - window_gap = 0; - window_shadow = "float"; - focus_follows_mouse = "autoraise"; - mouse_follows_focus = "on"; - mouse_modifier = "cmd"; - mouse_action1 = "move"; - mouse_action2 = "resize"; - mouse_drop_action = "swap"; - }; - extraConfig = '' - yabai -m rule --add app="^System Settings$" manage=off - yabai -m rule --add app="^Calculator$" manage=off - yabai -m rule --add app="^mpv" manage=off - ''; - }; - } -#+end_src diff --git a/macos.local/.flake/flake.nix.org b/macos.local/.flake/flake.nix.org index df858fb..9a07ccb 100644 --- a/macos.local/.flake/flake.nix.org +++ b/macos.local/.flake/flake.nix.org @@ -1,5 +1,6 @@ #+title: macOS Nix Configuration +The root for my macOS nix configuration using flake and home-manager. #+begin_src nix { description = "My Darwin Configuration"; diff --git a/macos.local/.flake/home/core.nix.org b/macos.local/.flake/home/core.nix.org index cec1e4f..4f0c7a9 100644 --- a/macos.local/.flake/home/core.nix.org +++ b/macos.local/.flake/home/core.nix.org @@ -9,18 +9,30 @@ Set up home manager for my user account and import submodules. ./clang-format.nix ./fonts.nix ./programs/core.nix + ./scripts/core.nix ]; + 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 = [ "/opt/homebrew/bin" "$HOME/.local/bin" "/usr/local/bin" ]; - - home.stateVersion = "24.05"; - programs.home-manager.enable = true; } #+end_src diff --git a/macos.local/.flake/home/programs/core.nix.org b/macos.local/.flake/home/programs/core.nix.org index 59dd331..96302e9 100644 --- a/macos.local/.flake/home/programs/core.nix.org +++ b/macos.local/.flake/home/programs/core.nix.org @@ -1,5 +1,6 @@ #+title: Core Program Configuration +Import configurations for programs and install programs with no configuration. #+begin_src nix { config, pkgs, ... }: diff --git a/macos.local/.flake/home/programs/emacs/core.nix.org b/macos.local/.flake/home/programs/emacs/core.nix.org index 599dd54..4630b0f 100644 --- a/macos.local/.flake/home/programs/emacs/core.nix.org +++ b/macos.local/.flake/home/programs/emacs/core.nix.org @@ -1,5 +1,6 @@ #+title: Emacs Configuration +Here is my Emacs configuration. Define configuration files that should exist. #+begin_src nix { config, pkgs, ... }: @@ -12,43 +13,61 @@ "./.config/emacs/user-interface.el".source = ./user-interface.el; "./.config/emacs/tools.el".source = ./tools.el; "./.config/emacs/languages.el".source = ./languages.el; - "./Applications/Emacs.app/Contents/MacOS/Emacs" = { - executable = true; - text = '' - #!/bin/sh - emacsclient -c & disown - ''; - }; +#+end_src + +Define a macOS application wrapper for =emacsclient=. +#+begin_src nix + "./Applications/Emacs.app/Contents/MacOS/Emacs" = { + executable = true; + text = '' +#+end_src + +Run =emacsclient= and disown the process before closing. +#+begin_src sh + #!/bin/sh + emacsclient -c & disown +#+end_src + +Close the block. +#+begin_src nix + ''; }; + }; +#+end_src - nixpkgs.overlays = [ - (final: prev: - { - emacs29-pgtk = prev.emacs29-pgtk.overrideAttrs (old: { - patches = - (old.patches or []) - ++ [ - # Fix OS window role (needed for window managers like yabai) - (prev.fetchpatch { - url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-28/fix-window-role.patch"; - sha256 = "sha256-+z/KfsBm1lvZTZNiMbxzXQGRTjkCFO4QPlEK35upjsE="; - }) - # Enable rounded window with no decoration - (prev.fetchpatch { - url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-29/round-undecorated-frame.patch"; - sha256 = "sha256-uYIxNTyfbprx5mCqMNFVrBcLeo+8e21qmBE3lpcnd+4="; - }) - # Make Emacs aware of OS-level light/dark mode - (prev.fetchpatch { - url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-28/system-appearance.patch"; - sha256 = "sha256-oM6fXdXCWVcBnNrzXmF0ZMdp8j0pzkLE66WteeCutv8="; - }) - ]; - }); - } - ) - ]; +Apply patches from =d12frosted/emacs-plus= Homebrew package for Emacs: +- Fix OS window role (=yabai= needs this to tile Emacs) +- Enable rounded window with no decoration (I don't really use this) +- Make Emacs aware of OS-level light/dark mode +#+begin_src nix + nixpkgs.overlays = [ + (final: prev: + { + emacs29-pgtk = prev.emacs29-pgtk.overrideAttrs (old: { + patches = + (old.patches or []) + ++ [ + (prev.fetchpatch { + url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-28/fix-window-role.patch"; + sha256 = "sha256-+z/KfsBm1lvZTZNiMbxzXQGRTjkCFO4QPlEK35upjsE="; + }) + (prev.fetchpatch { + url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-29/round-undecorated-frame.patch"; + sha256 = "sha256-uYIxNTyfbprx5mCqMNFVrBcLeo+8e21qmBE3lpcnd+4="; + }) + (prev.fetchpatch { + url = "https://raw.githubusercontent.com/d12frosted/homebrew-emacs-plus/master/patches/emacs-28/system-appearance.patch"; + sha256 = "sha256-oM6fXdXCWVcBnNrzXmF0ZMdp8j0pzkLE66WteeCutv8="; + }) + ]; + }); + } + ) + ]; +#+end_src +Install Emacs program and service. +#+begin_src nix programs.emacs = { enable = true; package = pkgs.emacs29-pgtk; diff --git a/macos.local/.flake/home/programs/ssh.nix.org b/macos.local/.flake/home/programs/ssh.nix.org index 09eb34f..e9cf7ad 100644 --- a/macos.local/.flake/home/programs/ssh.nix.org +++ b/macos.local/.flake/home/programs/ssh.nix.org @@ -1,5 +1,6 @@ #+title: SSH Configuration +Configure SSH. Keys should be added to the SSH agent. Specify the key file and use the system keychain. #+begin_src nix { config, pkgs, ... }: { @@ -13,15 +14,27 @@ "UseKeychain" = "yes"; }; }; - "aviary" = { - hostname = "aviary.cs.umanitoba.ca"; - user = "janzenj2"; - }; - "jjanzen.ca" = { - setEnv = { - "TERM" = "xterm"; - }; - }; +#+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"; + }; +#+end_src + +Here is my web server at =jjanzen.ca=. Set the =$TERM= variable to =xterm=. +#+begin_src nix + "jjanzen.ca" = { + setEnv = { + "TERM" = "xterm"; + }; + }; +#+end_src + +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/scripts.nix.org b/macos.local/.flake/home/scripts.nix.org deleted file mode 100644 index 6bf46a6..0000000 --- a/macos.local/.flake/home/scripts.nix.org +++ /dev/null @@ -1,18 +0,0 @@ -#+title: Custom Scripts - -#+begin_src nix - { config, pkgs, ... }: - - { - home.file = { - ".local/bin/launcher" = { - text '' - #!/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" - ''; - executable = true; - }; - }; - } -#+end_src diff --git a/macos.local/.flake/home/scripts/core.nix.org b/macos.local/.flake/home/scripts/core.nix.org new file mode 100644 index 0000000..2a908c0 --- /dev/null +++ b/macos.local/.flake/home/scripts/core.nix.org @@ -0,0 +1,13 @@ +#+title: Custom Scripts + +Import various scripts useful on my system. +#+begin_src nix + { config, pkgs, ... }: + + { + imports = [ + ./launcher.nix + ./remove-quarantine.nix + ]; + } +#+end_src diff --git a/macos.local/.flake/home/scripts/launcher.nix.org b/macos.local/.flake/home/scripts/launcher.nix.org new file mode 100644 index 0000000..b9debc7 --- /dev/null +++ b/macos.local/.flake/home/scripts/launcher.nix.org @@ -0,0 +1,26 @@ +#+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/remove-quarantine.nix.org b/macos.local/.flake/home/scripts/remove-quarantine.nix.org new file mode 100644 index 0000000..fa8d882 --- /dev/null +++ b/macos.local/.flake/home/scripts/remove-quarantine.nix.org @@ -0,0 +1,24 @@ +#+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/system/core.nix.org b/macos.local/.flake/system/core.nix.org index c80f3eb..13e3d97 100644 --- a/macos.local/.flake/system/core.nix.org +++ b/macos.local/.flake/system/core.nix.org @@ -1,47 +1,87 @@ #+title: System Core This file imports various system configuration components in addition to enabling flakes and defining the system version. - #+begin_src nix { config, pkgs, ... }: let - inherit (pkgs) aspellWithDicts; +#+end_src - myaspell = aspellWithDicts (d: [d.en d.en-computers d.en-science]); - in { - nixpkgs.config.allowUnfree = true; +Add =aspell= dictionaries. +#+begin_src nix + inherit (pkgs) aspellWithDicts; + myaspell = aspellWithDicts (d: [d.en d.en-computers d.en-science]); +#+end_src + +Import submodules. +#+begin_src nix + in { imports = [ ./homebrew.nix ./skhd.nix ./yabai.nix ]; +#+end_src - environment.systemPackages = with pkgs; [ - gnupg - myaspell - neovim - skhd - ]; +Allow unfree packages. +#+begin_src nix + nixpkgs.config.allowUnfree = true; +#+end_src - security.pam.enableSudoTouchIdAuth = true; +Install system packages. +#+begin_src nix + environment.systemPackages = with pkgs; [ + gnupg + myaspell + neovim + skhd + ]; +#+end_src + +Use Touch ID for =sudo= authentication. +#+begin_src nix + security.pam.enableSudoTouchIdAuth = true; +#+end_src - environment.variables.EDITOR = "nvim"; +Use Neovim as my default editor. +#+begin_src nix + environment.variables.EDITOR = "nvim"; +#+end_src - programs.gnupg.agent.enable = true; +Enable GPG agent. +#+begin_src nix + programs.gnupg.agent.enable = true; +#+end_src - services.nix-daemon.enable = true; - nix.package = pkgs.nix; +Enable =nix= daemon. +#+begin_src nix + services.nix-daemon.enable = true; + nix.package = pkgs.nix; +#+end_src - nix.settings.experimental-features = "nix-command flakes"; +Enable flakes. +#+begin_src nix + nix.settings.experimental-features = "nix-command flakes"; +#+end_src - programs.zsh.enable = true; +Use =zsh= as my shell. +#+begin_src nix + programs.zsh.enable = true; +#+end_src +Necessary boilerplate. +#+begin_src nix system.stateVersion = 5; +#+end_src +Use ARM packages for Darwin. +#+begin_src nix nixpkgs.hostPlatform = "aarch64-darwin"; +#+end_src +Define my users. +#+begin_src nix users.users.jjanzen = { name = "jjanzen"; home = "/Users/jjanzen"; diff --git a/macos.local/.flake/system/homebrew.nix.org b/macos.local/.flake/system/homebrew.nix.org index b92958c..2e92897 100644 --- a/macos.local/.flake/system/homebrew.nix.org +++ b/macos.local/.flake/system/homebrew.nix.org @@ -1,124 +1,140 @@ #+title: Homebrew Configuration +Set up Homebrew. #+begin_src nix { config, pkgs, ... }: { homebrew = { enable = true; - brews = [ - "aescrypt" - "aspell" - "avrdude" - "bash-language-server" - "bear" - "biber" - "binutils" - "bison" - "btop" - "choose-gui" - "clang-format" - "cmake" - "cmake-language-server" - "coreutils" - "curl" - "dos2unix" - "dotnet" - "eza" - "fd" - "gcc" - "gnutls" - "ffmpeg" - "fzf" - "go" - "gpgme" - "grep" - "htop" - "hunspell" - "hyfetch" - "imagemagick" - "ispell" - "jq" - "lesspipe" - "latexdiff" - "libgccjit" - "llvm@18" - "marksman" - "meson" - "mono" - "mpv" - "ninja" - "nmap" - "open-mpi" - "open-ocd" - "openjdk" - "pandoc" - "pinentry-mac" - "ripgrep" - "rsync" - "rust" - "sevenzip" - "shellcheck" - "shfmt" - "telnet" - "texlab" - "tree-sitter" - "typescript-language-server" - "wget" - "yt-dlp" - { - name = "d12frosted/emacs-plus/emacs-plus@29"; - args = [ "with-imagemagick" ]; - } - "felixkratz/formulae/sketchybar" - "osx-cross/avr/avr-binutils" - "osx-cross/avr/avarice" - "osx-cross/avr/avr-gcc@14" - ]; - caskArgs.no_quarantine = true; - casks = [ - "alacritty" - "audacity" - "blender" - "cabal" - "calibre" - "desmume" - "gcc-arm-embedded" - "gimp" - "godot" - "inkscape" - "krita" - "mactex" - "multimc" - "obs" - "openemu" - "pokemon-showdown" - "protonmail-bridge" - "protonvpn" - "qbittorrent" - "rar" - "syncthing" - "thunderbird" - "vlc" - "whisky" - "zen-browser" - "zotero" - ]; - global.autoUpdate = false; - onActivation = { - autoUpdate = false; - cleanup = "zap"; - upgrade = true; - }; - taps = [ - "d12frosted/emacs-plus" - "felixkratz/formulae" - "homebrew/bundle" - "homebrew/cask-fonts" - "homebrew/cask-versions" - "homebrew/services" - "osx-cross/avr" - ]; +#+end_src + +Do not quarantine casks. +#+begin_src nix + caskArgs.no_quarantine = true; +#+end_src + +Don't automatically update except with Nix update and clean up any packages that are not listed. +#+begin_src nix + global.autoUpdate = false; + onActivation = { + autoUpdate = false; + cleanup = "zap"; + upgrade = true; + }; +#+end_src + +List the taps to use on Homebrew. +#+begin_src nix + taps = [ + "felixkratz/formulae" + "homebrew/bundle" + "homebrew/cask-fonts" + "homebrew/cask-versions" + "homebrew/services" + "osx-cross/avr" + ]; +#+end_src + +List packages to install with Homebrew. +#+begin_src nix + brews = [ + "aescrypt" + "avrdude" + "bash-language-server" + "bear" + "binutils" + "bison" + "choose-gui" + "clang-format" + "cmake" + "cmake-language-server" + "coreutils" + "curl" + "dos2unix" + "dotnet" + "eza" + "fd" + "gcc" + "gnutls" + "ffmpeg" + "fzf" + "go" + "gpgme" + "grep" + "htop" + "hunspell" + "hyfetch" + "imagemagick" + "ispell" + "jq" + "lesspipe" + "latexdiff" + "libgccjit" + "llvm@18" + "marksman" + "meson" + "mono" + "mpv" + "ninja" + "nmap" + "open-mpi" + "open-ocd" + "openjdk" + "pandoc" + "pinentry-mac" + "ripgrep" + "rsync" + "rust" + "sevenzip" + "shellcheck" + "shfmt" + "telnet" + "tree-sitter" + "typescript-language-server" + "wget" + "yt-dlp" + "felixkratz/formulae/sketchybar" + "osx-cross/avr/avr-binutils" + "osx-cross/avr/avarice" + "osx-cross/avr/avr-gcc@14" + ]; +#+end_src + +List casks to install with Homebrew. +#+begin_src nix + casks = [ + "alacritty" + "audacity" + "blender" + "cabal" + "calibre" + "desmume" + "gcc-arm-embedded" + "gimp" + "godot" + "inkscape" + "krita" + "mactex" + "multimc" + "obs" + "openemu" + "pokemon-showdown" + "protonmail-bridge" + "protonvpn" + "qbittorrent" + "rar" + "syncthing" + "thunderbird" + "vlc" + "whisky" + "zen-browser" + "zotero" + ]; +#+end_src + +Close Homebrew configuration +#+begin_src nix }; } #+end_src diff --git a/macos.local/.flake/system/skhd.nix.org b/macos.local/.flake/system/skhd.nix.org index 2e81cc0..086a750 120000..100644 --- a/macos.local/.flake/system/skhd.nix.org +++ b/macos.local/.flake/system/skhd.nix.org @@ -1 +1,97 @@ -../../../common/.flake/system/skhd.nix.org
\ No newline at end of file +#+title: SKHD Configuration + +I use =skhd= to configure keyboard bindings. +#+begin_src nix + { config, pkgs, ... }: + + { + services.skhd = { + enable = true; + skhdConfig = '' +#+end_src + +Use =⌘-Enter= to open my terminal. +#+begin_src text + cmd - return : /opt/homebrew/bin/alacritty +#+end_src + +Close a window with =⌘-Shift-Q= to close a window. +#+begin_src text + cmd + shift - q : yabai -m window --close +#+end_src + +Launch an application with =⌘-D=. +#+begin_src text + cmd - d : ~/.local/bin/launcher +#+end_src + +Reload the configuration with =⌘-Shift-C=. +#+begin_src text + cmd + shift - c : yabai --restart-service && skhd --restart-service +#+end_src + +Move focus with =⌘-[HJKL]= to move left (H), down (J), up (K), or right (L). +#+begin_src text + cmd - h : yabai -m window --focus west || yabai -m display --focus west + cmd - j : yabai -m window --focus south || yabai -m display --focus south + cmd - k : yabai -m window --focus north || yabai -m display --focus north + cmd - l : yabai -m window --focus east || yabai -m display --focus east +#+end_src + +Move window with =⌘-Shift-[HJKL]= to move left (H), down (J), up (K), or right (L). +#+begin_src text + shift + cmd - h : yabai -m window --warp west + shift + cmd - j : yabai -m window --warp south + shift + cmd - k : yabai -m window --warp north + shift + cmd - l : yabai -m window --warp east +#+end_src + +Move to space =x= with =⌘-x=. +#+begin_src text + cmd - 1 : yabai -m space --focus 1 + cmd - 2 : yabai -m space --focus 2 + cmd - 3 : yabai -m space --focus 3 + cmd - 4 : yabai -m space --focus 4 + cmd - 5 : yabai -m space --focus 5 + cmd - 6 : yabai -m space --focus 6 + cmd - 7 : yabai -m space --focus 7 + cmd - 8 : yabai -m space --focus 8 + cmd - 9 : yabai -m space --focus 9 + cmd - 0 : yabai -m space --focus 10 +#+end_src + +Move application to space =x= with =⌘-=Shift-x=. +#+begin_src text + cmd + shift - 1 : yabai -m window --space 1 + cmd + shift - 2 : yabai -m window --space 2 + cmd + shift - 3 : yabai -m window --space 3 + cmd + shift - 4 : yabai -m window --space 4 + cmd + shift - 5 : yabai -m window --space 5 + cmd + shift - 6 : yabai -m window --space 6 + cmd + shift - 7 : yabai -m window --space 7 + cmd + shift - 8 : yabai -m window --space 8 + cmd + shift - 9 : yabai -m window --space 9 + cmd + shift - 0 : yabai -m window --space 10 +#+end_src + +Toggle fullscreen with =⌘-Shift-F=. +#+begin_src text + cmd + shift - f : yabai -m window --toggle zoom-fullscreen +#+end_src + +Toggle floating with =⌘-Shift-Space=. +#+begin_src text + cmd + shift - space : yabai -m window --toggle float +#+end_src + +Take a screenshot with =⌘-Shift-S=. +#+begin_src text + cmd + shift - s : open /System/Applications/Utilities/Screenshot.app +#+end_src + +Close the block. +#+begin_src nix + ''; + }; + } +#+end_src diff --git a/macos.local/.flake/system/yabai.nix.org b/macos.local/.flake/system/yabai.nix.org index 08a3a0b..1c70dcc 120000..100644 --- a/macos.local/.flake/system/yabai.nix.org +++ b/macos.local/.flake/system/yabai.nix.org @@ -1 +1,61 @@ -../../../common/.flake/system/yabai.nix.org
\ No newline at end of file +#+title: Yabai Configuration + +#+begin_src nix + { config, pkgs, ... }: + + { + services.yabai = { + enable = true; +#+end_src + +Use scripting addition features. +#+begin_src nix + enableScriptingAddition = true; + config = { +#+end_src + +Use auto-tiling. +#+begin_src nix + layout = "bsp"; + auto_balance = "on"; +#+end_src + +Do not use padding between windows. +#+begin_src nix + top_padding = 0; + bottom_padding = 0; + left_padding = 0; + right_padding = 0; + window_gap = 0; +#+end_src + +Disable window shadows unless the application is floating. +#+begin_src nix + window_shadow = "float"; +#+end_src + +Mouse moves to focused window and windows are focused on mouse hover. +#+begin_src nix + focus_follows_mouse = "autoraise"; + mouse_follows_focus = "on"; +#+end_src + +Use =⌘= with the mouse to move and resize. +#+begin_src nix + mouse_modifier = "cmd"; + mouse_action1 = "move"; + mouse_action2 = "resize"; + mouse_drop_action = "swap"; +#+end_src + +Add exceptions for some apps. +#+begin_src nix + }; + extraConfig = '' + yabai -m rule --add app="^System Settings$" manage=off + yabai -m rule --add app="^Calculator$" manage=off + yabai -m rule --add app="^mpv" manage=off + ''; + }; + } +#+end_src |