aboutsummaryrefslogtreecommitdiff
path: root/macos.local/.flake/home
diff options
context:
space:
mode:
authorJacob Janzen <jacob.a.s.janzen@gmail.com>2024-12-16 23:28:56 -0600
committerJacob Janzen <jacob.a.s.janzen@gmail.com>2024-12-16 23:28:56 -0600
commit26dd014860c0edd89a859d2d8c6dff10275acbad (patch)
treebe704eafeb9458cf202240dc0108f13501ae4272 /macos.local/.flake/home
parent530ee85037375106652e51a23cf05deb2a5ad1d9 (diff)
system changes
Diffstat (limited to 'macos.local/.flake/home')
-rw-r--r--macos.local/.flake/home/core.nix.org18
-rw-r--r--macos.local/.flake/home/programs/core.nix.org1
-rw-r--r--macos.local/.flake/home/programs/emacs/core.nix.org87
-rw-r--r--macos.local/.flake/home/programs/ssh.nix.org31
-rw-r--r--macos.local/.flake/home/scripts.nix.org18
-rw-r--r--macos.local/.flake/home/scripts/core.nix.org13
-rw-r--r--macos.local/.flake/home/scripts/launcher.nix.org26
-rw-r--r--macos.local/.flake/home/scripts/remove-quarantine.nix.org24
8 files changed, 154 insertions, 64 deletions
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