From b82f13aba6874b08ceb02534f10344e66dd8e2c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 10:33:26 -0700 Subject: [PATCH 01/39] Restore Safari defaults --- modules/darwin/system-defaults.nix | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/modules/darwin/system-defaults.nix b/modules/darwin/system-defaults.nix index 80103496..77ab1723 100644 --- a/modules/darwin/system-defaults.nix +++ b/modules/darwin/system-defaults.nix @@ -75,23 +75,14 @@ "com.apple.desktopservices" = { DSDontWriteNetworkStores = true; }; - # Requires disabling SIP? - # "com.apple.Safari" = { - # AutoOpenSafeDownloads = false; # Prevent opening "safe" files automatically - # ShowFullURLInSmartSearchField = false; - # ShowFavoritesBar = false; - # WebContinuousSpellCheckingEnabled = true; - # WebAutomaticSpellingCorrectionEnabled = false; - # WarnAboutFraudulentWebsites = true; - # "com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled" = false; - # # Develop menu - # IncludeDevelopMenu = true; - # WebKitDeveloperExtrasEnabledPreferenceKey = true; - # "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" = true; - - # # TODO: Set "compact" tab layout - # }; + "com.apple.Safari" = { + AutoOpenSafeDownloads = false; # Prevent opening "safe" files automatically + ShowFullURLInSmartSearchField = false; + ShowFavoritesBar = false; + IncludeDevelopMenu = true; + WebKitDeveloperExtrasEnabledPreferenceKey = true; + }; # TODO: Handle in disable-update module "at.obdev.littlesnitch.softwareupdate".SoftwareUpdateCheckAutomatically = false; From 460cdab9211806632bac03e3fc4c116f965bcabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 10:34:58 -0700 Subject: [PATCH 02/39] Rename favorites bar key --- modules/darwin/system-defaults.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/darwin/system-defaults.nix b/modules/darwin/system-defaults.nix index 77ab1723..7381b9ef 100644 --- a/modules/darwin/system-defaults.nix +++ b/modules/darwin/system-defaults.nix @@ -79,7 +79,7 @@ "com.apple.Safari" = { AutoOpenSafeDownloads = false; # Prevent opening "safe" files automatically ShowFullURLInSmartSearchField = false; - ShowFavoritesBar = false; + "ShowFavoritesBar-v2" = false; IncludeDevelopMenu = true; WebKitDeveloperExtrasEnabledPreferenceKey = true; }; From 521e26cc8f96db732cc751de17041d12d466500d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 10:36:42 -0700 Subject: [PATCH 03/39] Add note See: https://github.com/nix-darwin/nix-darwin/issues/1111 --- modules/darwin/system-defaults.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/darwin/system-defaults.nix b/modules/darwin/system-defaults.nix index 7381b9ef..1420d65e 100644 --- a/modules/darwin/system-defaults.nix +++ b/modules/darwin/system-defaults.nix @@ -76,6 +76,7 @@ DSDontWriteNetworkStores = true; }; + # N.B.: Terminal requires Full Disk Access to apply Safari defaults "com.apple.Safari" = { AutoOpenSafeDownloads = false; # Prevent opening "safe" files automatically ShowFullURLInSmartSearchField = false; From 770da3b3eb878ed4f54518bf12728125af1e80c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 10:47:17 -0700 Subject: [PATCH 04/39] Remove commented keyboard shortcuts Going to track as an issue instead: https://github.com/stackptr/rc/issues/142 --- modules/darwin/default.nix | 43 -------------------------------------- 1 file changed, 43 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index ca3dbd7a..65b1599d 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -40,49 +40,6 @@ system.configurationRevision = self.rev or self.dirtyRev or null; - # TODO: Keyboard shortcuts, see nix-darwin/nix-darwin#699 - # system.keyboard.shortcuts = let - # cmdOptLeft = { - # mods = { - # option = true; - # command = true; - # }; - # key = "left"; - # }; - # cmdOptRight = { - # mods = { - # option = true; - # command = true; - # }; - # key = "right"; - # }; - # in { - # enable = true; - # appShortcuts = { - # "Preview.app" = { - # "Show Previous Tab" = cmdOptLeft; - # "Show Next Tab" = cmdOptRight - # }; - # "Finder.app" = { - # "Show Previous Tab" = cmdOptLeft; - # "Show Next Tab" = cmdOptRight - # }; - # "Prompt.app" = { - # "Show Previous Tab" = cmdOptLeft; - # "Show Next Tab" = cmdOptRight - # }; - # "Mail.app" = { - # "Archive" = { - # key = "right"; - # }; - # }; - # "Nova.app" = { - # "Show Previous Tab" = cmdOptLeft; - # "Show Next Tab" = cmdOptRight - # }; - # }; - # }; - # Auto upgrade nix package and the daemon service. nix.enable = true; nix.package = pkgs.nix; From c0e2f4f1b49458f28420979aeebeb4246cddc1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 10:53:55 -0700 Subject: [PATCH 05/39] Consolidate darwin modules --- modules/darwin/default.nix | 177 ++++++++++++++++++++++++++++- modules/darwin/fonts.nix | 10 -- modules/darwin/homebrew.nix | 63 ---------- modules/darwin/security.nix | 23 ---- modules/darwin/startup-apps.nix | 15 --- modules/darwin/system-defaults.nix | 91 --------------- 6 files changed, 172 insertions(+), 207 deletions(-) delete mode 100644 modules/darwin/fonts.nix delete mode 100644 modules/darwin/homebrew.nix delete mode 100644 modules/darwin/security.nix delete mode 100644 modules/darwin/startup-apps.nix delete mode 100644 modules/darwin/system-defaults.nix diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 65b1599d..222286d1 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -8,16 +8,72 @@ imports = [ ./disable-updates.nix ./fastscripts.nix - ./fonts.nix - ./homebrew.nix ./popclip.nix ./scroll-reverser.nix - ./security.nix ./start-on-activation.nix - ./startup-apps.nix - ./system-defaults.nix ]; + fonts.packages = [ + pkgs.nerd-fonts.meslo-lg # Supplies MesloLGSDZ: Line Gap Small, Dotted Zero + ]; + + homebrew = { + enable = true; + caskArgs.no_quarantine = true; + onActivation = { + cleanup = "zap"; + upgrade = true; + }; + taps = builtins.attrNames config.nix-homebrew.taps; # See: zhaofengli/nix-homebrew#5 + # N.B.: Apps marked auto_updates will not be updated by homebrew. These apps should + # have their updates disabled and then marked `greedy` to force homebrew to update. + casks = let + greedyApps = + map (name: { + inherit name; + greedy = true; + }) [ + "craft" + "nova" + "postico" + "roon" + "tailscale-app" + ]; + otherApps = [ + "legcord" + "plex" # auto_updates + "textual" + ]; + in + lib.concatLists [ + greedyApps + otherApps + ]; + # N.B.: Removed entries in `masApps` require manual uninstallation + masApps = { + "Copilot" = 1447330651; + "Folder Quick Look" = 6753110395; + "GoodLinks" = 1474335294; + "Hand Mirror" = 1502839586; + "Hush" = 1544743900; + "Mapper" = 1589391989; + "Mela" = 1568924476; + "MusicBox" = 1614730313; + "Numbers" = 409203825; + "Noir" = 1592917505; + "Pages" = 409201541; + "Paku" = 1534130193; + "Parcel" = 375589283; + "Pixea" = 1507782672; + "Play" = 1596506190; + "Prompt" = 1594420480; + "Reeder" = 1529448980; + "Timery" = 1425368544; + "Things" = 904280696; + "Wipr" = 1320666476; + }; + }; + programs.fastscripts = { enable = true; userScripts = { @@ -38,6 +94,117 @@ enable = true; }; + security.pam.services.sudo_local = { + reattach = true; + touchIdAuth = true; + }; + + system.disableUpdates = [ + "at.eggerapps.Postico" + "com.colliderli.iina" + "com.daisydiskapp.DaisyDiskStandAlone" + "com.lukilabs.lukiapp" # Craft + "com.panic.Nova" + "com.red-sweater.fastscripts" + "com.rogueamoeba.soundsource" + "io.tailscale.ipn.macsys" + "org.sbarex.QLMarkdown" + ]; + + system.startOnActivation = { + "FastScripts" = "${pkgs.fastscripts}/Applications/FastScripts.app/"; + "Hand Mirror" = "/Applications/Hand\ Mirror.app/"; + "PopClip" = "/Applications/PopClip.app/"; + "Scroll Reverser" = "${pkgs.scroll-reverser}/Applications/Scroll\ Reverser.app/"; + "SoundSource" = "${pkgs.soundsource}/Applications/SoundSource.app/"; + "Tailscale" = "/Applications/Tailscale.app/"; + }; + + system.defaults = { + ".GlobalPreferences"."com.apple.mouse.scaling" = 1.5; + LaunchServices.LSQuarantine = false; + NSGlobalDomain = { + AppleScrollerPagingBehavior = true; # Jump to spot on scroll bar when clicked + NSAutomaticCapitalizationEnabled = false; + NSAutomaticDashSubstitutionEnabled = false; + NSAutomaticPeriodSubstitutionEnabled = false; + NSAutomaticQuoteSubstitutionEnabled = false; # Disable smart quoting + NSAutomaticSpellingCorrectionEnabled = false; + "com.apple.springing.enabled" = true; + "com.apple.springing.delay" = 0.5; + # "com.apple.trackpad.forceClick" = 1; # TODO + "com.apple.trackpad.scaling" = 1.0; + + # Always use expanded save panel + NSNavPanelExpandedStateForSaveMode = true; + NSNavPanelExpandedStateForSaveMode2 = true; + + # Quickly repeat keys when held + InitialKeyRepeat = 15; + KeyRepeat = 2; + }; + # TODO: + # showAppExposeGestureEnabled = 1; + # showMissionControlGestureEnabled = 1; + dock = { + appswitcher-all-displays = false; + autohide = false; + mineffect = "scale"; + minimize-to-application = false; + mru-spaces = false; + orientation = "bottom"; + show-process-indicators = false; + showhidden = false; + show-recents = false; + static-only = false; + magnification = true; + + # Disable hot corners + wvous-tl-corner = 1; + wvous-bl-corner = 1; + wvous-tr-corner = 1; + wvous-br-corner = 1; + }; + finder = { + AppleShowAllFiles = false; + ShowStatusBar = false; + ShowPathbar = false; + FXDefaultSearchScope = "SCcf"; # Search current folder first when searching + FXPreferredViewStyle = "Nlsv"; # Prefer list view + AppleShowAllExtensions = true; + FXEnableExtensionChangeWarning = false; # Do not warn when changing file extensions + }; + menuExtraClock = { + ShowAMPM = true; + ShowDayOfWeek = false; + ShowDate = 0; # Show full date + }; + screencapture.location = "~/Downloads"; + trackpad = { + Clicking = true; # tap to click + Dragging = true; # tap to drag + TrackpadThreeFingerDrag = true; + }; + }; + + system.defaults.CustomUserPreferences = { + "com.apple.desktopservices" = { + DSDontWriteNetworkStores = true; + }; + + # N.B.: Terminal requires Full Disk Access to apply Safari defaults + "com.apple.Safari" = { + AutoOpenSafeDownloads = false; # Prevent opening "safe" files automatically + ShowFullURLInSmartSearchField = false; + "ShowFavoritesBar-v2" = false; + IncludeDevelopMenu = true; + WebKitDeveloperExtrasEnabledPreferenceKey = true; + }; + + # TODO: Handle in disable-update module + "at.obdev.littlesnitch.softwareupdate".SoftwareUpdateCheckAutomatically = false; + }; + system.configurationRevision = self.rev or self.dirtyRev or null; # Auto upgrade nix package and the daemon service. diff --git a/modules/darwin/fonts.nix b/modules/darwin/fonts.nix deleted file mode 100644 index fa6f9fbd..00000000 --- a/modules/darwin/fonts.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - fonts.packages = [ - pkgs.nerd-fonts.meslo-lg # Supplies MesloLGSDZ: Line Gap Small, Dotted Zero - ]; -} diff --git a/modules/darwin/homebrew.nix b/modules/darwin/homebrew.nix deleted file mode 100644 index 1956beb1..00000000 --- a/modules/darwin/homebrew.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - homebrew = { - enable = true; - caskArgs.no_quarantine = true; - onActivation = { - cleanup = "zap"; - upgrade = true; - }; - taps = builtins.attrNames config.nix-homebrew.taps; # See: zhaofengli/nix-homebrew#5 - # N.B.: Apps marked auto_updates will not be updated by homebrew. These apps should - # have their updates disabled and then marked `greedy` to force homebrew to update. - casks = let - greedyApps = - map (name: { - inherit name; - greedy = true; - }) [ - "craft" - "nova" - "postico" - "roon" - "tailscale-app" - ]; - otherApps = [ - "legcord" - "plex" # auto_updates - "textual" - ]; - in - lib.concatLists [ - greedyApps - otherApps - ]; - # N.B.: Removed entries in `masApps` require manual uninstallation - masApps = { - "Copilot" = 1447330651; - "Folder Quick Look" = 6753110395; - "GoodLinks" = 1474335294; - "Hand Mirror" = 1502839586; - "Hush" = 1544743900; - "Mapper" = 1589391989; - "Mela" = 1568924476; - "MusicBox" = 1614730313; - "Numbers" = 409203825; - "Noir" = 1592917505; - "Pages" = 409201541; - "Paku" = 1534130193; - "Parcel" = 375589283; - "Pixea" = 1507782672; - "Play" = 1596506190; - "Prompt" = 1594420480; - "Reeder" = 1529448980; - "Timery" = 1425368544; - "Things" = 904280696; - "Wipr" = 1320666476; - }; - }; -} diff --git a/modules/darwin/security.nix b/modules/darwin/security.nix deleted file mode 100644 index 70768056..00000000 --- a/modules/darwin/security.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - security.pam.services.sudo_local = { - reattach = true; - touchIdAuth = true; - }; - - system.disableUpdates = [ - "at.eggerapps.Postico" - "com.colliderli.iina" - "com.daisydiskapp.DaisyDiskStandAlone" - "com.lukilabs.lukiapp" # Craft - "com.panic.Nova" - "com.red-sweater.fastscripts" - "com.rogueamoeba.soundsource" - "io.tailscale.ipn.macsys" - "org.sbarex.QLMarkdown" - ]; -} diff --git a/modules/darwin/startup-apps.nix b/modules/darwin/startup-apps.nix deleted file mode 100644 index e3c4e76f..00000000 --- a/modules/darwin/startup-apps.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - system.startOnActivation = { - "FastScripts" = "${pkgs.fastscripts}/Applications/FastScripts.app/"; - "Hand Mirror" = "/Applications/Hand\ Mirror.app/"; - "PopClip" = "/Applications/PopClip.app/"; - "Scroll Reverser" = "${pkgs.scroll-reverser}/Applications/Scroll\ Reverser.app/"; - "SoundSource" = "${pkgs.soundsource}/Applications/SoundSource.app/"; - "Tailscale" = "/Applications/Tailscale.app/"; - }; -} diff --git a/modules/darwin/system-defaults.nix b/modules/darwin/system-defaults.nix deleted file mode 100644 index 1420d65e..00000000 --- a/modules/darwin/system-defaults.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - system.defaults = { - ".GlobalPreferences"."com.apple.mouse.scaling" = 1.5; - LaunchServices.LSQuarantine = false; - NSGlobalDomain = { - AppleScrollerPagingBehavior = true; # Jump to spot on scroll bar when clicked - NSAutomaticCapitalizationEnabled = false; - NSAutomaticDashSubstitutionEnabled = false; - NSAutomaticPeriodSubstitutionEnabled = false; - NSAutomaticQuoteSubstitutionEnabled = false; # Disable smart quoting - NSAutomaticSpellingCorrectionEnabled = false; - "com.apple.springing.enabled" = true; - "com.apple.springing.delay" = 0.5; - # "com.apple.trackpad.forceClick" = 1; # TODO - "com.apple.trackpad.scaling" = 1.0; - - # Always use expanded save panel - NSNavPanelExpandedStateForSaveMode = true; - NSNavPanelExpandedStateForSaveMode2 = true; - - # Quickly repeat keys when held - InitialKeyRepeat = 15; - KeyRepeat = 2; - }; - # TODO: - # showAppExposeGestureEnabled = 1; - # showMissionControlGestureEnabled = 1; - dock = { - appswitcher-all-displays = false; - autohide = false; - mineffect = "scale"; - minimize-to-application = false; - mru-spaces = false; - orientation = "bottom"; - show-process-indicators = false; - showhidden = false; - show-recents = false; - static-only = false; - magnification = true; - - # Disable hot corners - wvous-tl-corner = 1; - wvous-bl-corner = 1; - wvous-tr-corner = 1; - wvous-br-corner = 1; - }; - finder = { - AppleShowAllFiles = false; - ShowStatusBar = false; - ShowPathbar = false; - FXDefaultSearchScope = "SCcf"; # Search current folder first when searching - FXPreferredViewStyle = "Nlsv"; # Prefer list view - AppleShowAllExtensions = true; - FXEnableExtensionChangeWarning = false; # Do not warn when changing file extensions - }; - menuExtraClock = { - ShowAMPM = true; - ShowDayOfWeek = false; - ShowDate = 0; # Show full date - }; - screencapture.location = "~/Downloads"; - trackpad = { - Clicking = true; # tap to click - Dragging = true; # tap to drag - TrackpadThreeFingerDrag = true; - }; - }; - - system.defaults.CustomUserPreferences = { - "com.apple.desktopservices" = { - DSDontWriteNetworkStores = true; - }; - - # N.B.: Terminal requires Full Disk Access to apply Safari defaults - "com.apple.Safari" = { - AutoOpenSafeDownloads = false; # Prevent opening "safe" files automatically - ShowFullURLInSmartSearchField = false; - "ShowFavoritesBar-v2" = false; - IncludeDevelopMenu = true; - WebKitDeveloperExtrasEnabledPreferenceKey = true; - }; - - # TODO: Handle in disable-update module - "at.obdev.littlesnitch.softwareupdate".SoftwareUpdateCheckAutomatically = false; - }; -} From 52772a2df307bc00ca586eab42359dcc013215dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 10:57:43 -0700 Subject: [PATCH 06/39] Remove redundant description `mkEnableOption` seems to prepend `"Whether to enable "` to the option descripton. --- modules/darwin/fastscripts.nix | 2 +- modules/darwin/popclip.nix | 2 +- modules/darwin/scroll-reverser.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/darwin/fastscripts.nix b/modules/darwin/fastscripts.nix index 88480c35..1c281cf9 100644 --- a/modules/darwin/fastscripts.nix +++ b/modules/darwin/fastscripts.nix @@ -28,7 +28,7 @@ with lib; let plistFile = config.programs.fastscripts.plistFile; in { options.programs.fastscripts = { - enable = mkEnableOption "Whether to enable FastScripts"; + enable = mkEnableOption "FastScripts"; userScripts = mkOption { type = types.attrsOf (types.submodule text); default = {}; diff --git a/modules/darwin/popclip.nix b/modules/darwin/popclip.nix index 677be1ef..ba7e1dbc 100644 --- a/modules/darwin/popclip.nix +++ b/modules/darwin/popclip.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.programs.popclip; in { options.programs.popclip = { - enable = mkEnableOption "Whether to enable PopClip"; + enable = mkEnableOption "PopClip"; }; config = mkIf cfg.enable { diff --git a/modules/darwin/scroll-reverser.nix b/modules/darwin/scroll-reverser.nix index 20a9798a..d656c7a5 100644 --- a/modules/darwin/scroll-reverser.nix +++ b/modules/darwin/scroll-reverser.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.programs.scroll-reverser; in { options.programs.scroll-reverser = { - enable = mkEnableOption "Whether to enable Scroll Reverser"; + enable = mkEnableOption "Scroll Reverser"; }; config = mkIf cfg.enable { From 8632d4063866fe9deaeeac9b6a9239a6ad034d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 11:00:14 -0700 Subject: [PATCH 07/39] Formatting --- modules/darwin/fastscripts.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/darwin/fastscripts.nix b/modules/darwin/fastscripts.nix index 1c281cf9..d7839d12 100644 --- a/modules/darwin/fastscripts.nix +++ b/modules/darwin/fastscripts.nix @@ -29,6 +29,7 @@ with lib; let in { options.programs.fastscripts = { enable = mkEnableOption "FastScripts"; + userScripts = mkOption { type = types.attrsOf (types.submodule text); default = {}; @@ -36,6 +37,7 @@ in { Set of files that have to be linked in {file}`~/Library/Scripts`. ''; }; + plistFile = mkOption { type = types.nullOr types.path; default = null; From 744935a00ecaf2ae3423005501163bcbfa145111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 11:04:27 -0700 Subject: [PATCH 08/39] Add `startOnActivation` options --- modules/darwin/default.nix | 6 +++--- modules/darwin/fastscripts.nix | 5 +++++ modules/darwin/popclip.nix | 5 +++++ modules/darwin/scroll-reverser.nix | 5 +++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 222286d1..f7e6efcc 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -83,15 +83,18 @@ }; }; plistFile = pkgs.writeText "fastscripts-keybindings.plist" (builtins.readFile ./fastscripts/keybindings.plist); + startOnActivation = true; }; # TODO: Ideally this would be in a Darwin-specific home-manager module programs.popclip = { enable = true; + startOnActivation = true; }; programs.scroll-reverser = { enable = true; + startOnActivation = true; }; security.pam.services.sudo_local = { @@ -112,10 +115,7 @@ ]; system.startOnActivation = { - "FastScripts" = "${pkgs.fastscripts}/Applications/FastScripts.app/"; "Hand Mirror" = "/Applications/Hand\ Mirror.app/"; - "PopClip" = "/Applications/PopClip.app/"; - "Scroll Reverser" = "${pkgs.scroll-reverser}/Applications/Scroll\ Reverser.app/"; "SoundSource" = "${pkgs.soundsource}/Applications/SoundSource.app/"; "Tailscale" = "/Applications/Tailscale.app/"; }; diff --git a/modules/darwin/fastscripts.nix b/modules/darwin/fastscripts.nix index d7839d12..58aa4421 100644 --- a/modules/darwin/fastscripts.nix +++ b/modules/darwin/fastscripts.nix @@ -48,6 +48,8 @@ in { This file can be obtained using: `plutil -convert xml1 -o - ~/Library/Preferences/com.red-sweater.fastscripts.plist > fastscripts.xml`. ''; }; + + startOnActivation = mkEnableOption "starting FastScripts on activation"; }; config = mkIf cfg.enable { @@ -64,6 +66,9 @@ in { '') userScripts} ''; + system.startOnActivation = mkIf cfg.startOnActivation { + "FastScripts" = "${pkgs.fastscripts}/Applications/FastScripts.app/"; + }; system.activationScripts.postActivation.text = let user = lib.escapeShellArg config.system.primaryUser; in diff --git a/modules/darwin/popclip.nix b/modules/darwin/popclip.nix index ba7e1dbc..bb1e5e56 100644 --- a/modules/darwin/popclip.nix +++ b/modules/darwin/popclip.nix @@ -9,6 +9,8 @@ with lib; let in { options.programs.popclip = { enable = mkEnableOption "PopClip"; + + startOnActivation = mkEnableOption "starting PopClip on activation"; }; config = mkIf cfg.enable { @@ -37,6 +39,9 @@ in { }; }; system.disableUpdates = ["com.pilotmoon.popclip"]; + system.startOnActivation = mkIf cfg.startOnActivation { + PopClip = "/Applications/PopClip.app/"; + }; system.activationScripts.popclipExtensions.text = '' popclipExtPlist=~/Library/Application\ Support/PopClip/Extensions/Extensions.plist if test -f "$popclipExtPlist"; then diff --git a/modules/darwin/scroll-reverser.nix b/modules/darwin/scroll-reverser.nix index d656c7a5..9e58c615 100644 --- a/modules/darwin/scroll-reverser.nix +++ b/modules/darwin/scroll-reverser.nix @@ -9,6 +9,8 @@ with lib; let in { options.programs.scroll-reverser = { enable = mkEnableOption "Scroll Reverser"; + + startOnActivation = mkEnableOption "starting Scroll Reverser on activation"; }; config = mkIf cfg.enable { @@ -22,5 +24,8 @@ in { StartAtLogin = true; }; }; + system.startOnActivation = mkIf cfg.startOnActivation { + "Scroll Reverser" = "${pkgs.scroll-reverser}/Applications/Scroll\ Reverser.app/"; + }; }; } From 6827fae8a42e84a9bdd955f2320f2db96019561b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 11:05:31 -0700 Subject: [PATCH 09/39] Move `system.disableUpdates` to module --- modules/darwin/default.nix | 1 - modules/darwin/fastscripts.nix | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index f7e6efcc..32533819 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -108,7 +108,6 @@ "com.daisydiskapp.DaisyDiskStandAlone" "com.lukilabs.lukiapp" # Craft "com.panic.Nova" - "com.red-sweater.fastscripts" "com.rogueamoeba.soundsource" "io.tailscale.ipn.macsys" "org.sbarex.QLMarkdown" diff --git a/modules/darwin/fastscripts.nix b/modules/darwin/fastscripts.nix index 58aa4421..9b488fe7 100644 --- a/modules/darwin/fastscripts.nix +++ b/modules/darwin/fastscripts.nix @@ -66,6 +66,7 @@ in { '') userScripts} ''; + system.disableUpdates = ["com.red-sweater.fastscripts"]; system.startOnActivation = mkIf cfg.startOnActivation { "FastScripts" = "${pkgs.fastscripts}/Applications/FastScripts.app/"; }; From e6a4a79ca1724df9d9f8951fccc77404697bee44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:01:10 -0700 Subject: [PATCH 10/39] Support custom keys in `system.disableUpdates` --- modules/darwin/disable-updates.nix | 70 +++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 16 deletions(-) diff --git a/modules/darwin/disable-updates.nix b/modules/darwin/disable-updates.nix index f291c9c1..8573c67e 100644 --- a/modules/darwin/disable-updates.nix +++ b/modules/darwin/disable-updates.nix @@ -5,33 +5,71 @@ }: with lib; let cfg = config.system.disableUpdates; + + updateOptions = {config, ...}: { + options = { + domain = mkOption { + type = types.str; + description = "Domain of application for which updates will be disabled"; + }; + + keys = mkOption { + type = types.listOf types.str; + description = "Keys used for software update"; + }; + }; + }; + + # Defaults from: https://github.com/sparkle-project/Sparkle/blob/2.x/Sparkle/SUConstants.m + defaultKeys = ["SUEnableAutomaticChecks" "SUAutomaticallyUpdate"]; in { options.system.disableUpdates = mkOption { - type = types.listOf types.str; + type = with types; + listOf (coercedTo str (domain: { + inherit domain; + keys = defaultKeys; + }) (submodule updateOptions)); default = []; example = literalExpression '' [ - "com.panic.Nova" + "com.example.App" + { + domain = "com.enterprise.App"; + keys = ["CustomSoftwareUpdateFramework"] + } ] ''; - description = '' - List of domains to write defaults that attempt to disable automatic software updates and associated prompts. + description = let + quoteStr = k: "\"${k}\""; + defaultKeysStr = builtins.concatStringsSep " " (map quoteStr defaultKeys); + in '' + List of domains and associated keys to write defaults that attempt to disable + automatic software updates and associated prompts. + + Domains defined as strings, e.g. "com.example.App", are shorthand for default keys: + + `{ domain = "com.example.App"; keys = [${defaultKeysStr}]; }` - Keys are set according to [constants](https://github.com/sparkle-project/Sparkle/blob/2.x/Sparkle/SUConstants.m) - in the Sparkle project, a popular software update framework, as well as some that have been determined - experimentally. + Default keys are from the Sparkle project, a popular software update framework. ''; }; config = mkIf (length cfg > 0) { - system.defaults.CustomUserPreferences = builtins.listToAttrs (map - (domain: { - name = domain; - value = { - SUEnableAutomaticChecks = false; - SUAutomaticallyUpdate = false; - }; - }) - cfg); + system.defaults.CustomUserPreferences = let + mkDisabledValues = keys: + builtins.listToAttrs (map (key: { + name = key; + value = false; + }) + keys); + in + builtins.listToAttrs (map + ( + e: { + name = e.domain; + value = mkDisabledValues e.keys; + } + ) + cfg); }; } From d3c996db6e3854a1ff56a0c067a1e26036606bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:02:02 -0700 Subject: [PATCH 11/39] Handle domain via `system.disableUpdates` --- modules/darwin/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 32533819..b6875eb0 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -111,6 +111,10 @@ "com.rogueamoeba.soundsource" "io.tailscale.ipn.macsys" "org.sbarex.QLMarkdown" + { + domain = "at.obdev.littlesnitch.softwareupdate"; + keys = ["SoftwareUpdateCheckAutomatically"]; + } ]; system.startOnActivation = { @@ -199,9 +203,6 @@ IncludeDevelopMenu = true; WebKitDeveloperExtrasEnabledPreferenceKey = true; }; - - # TODO: Handle in disable-update module - "at.obdev.littlesnitch.softwareupdate".SoftwareUpdateCheckAutomatically = false; }; system.configurationRevision = self.rev or self.dirtyRev or null; From 9b9dd0e0252c3ae931d257daab2b3c19457d5839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:07:06 -0700 Subject: [PATCH 12/39] Reorganize darwin modules --- modules/darwin/default.nix | 7 ++----- modules/darwin/programs/default.nix | 7 +++++++ modules/darwin/{ => programs}/fastscripts.nix | 0 modules/darwin/{ => programs}/popclip.nix | 0 modules/darwin/{ => programs}/scroll-reverser.nix | 0 modules/darwin/system/default.nix | 6 ++++++ modules/darwin/{ => system}/disable-updates.nix | 0 modules/darwin/{ => system}/start-on-activation.nix | 0 8 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 modules/darwin/programs/default.nix rename modules/darwin/{ => programs}/fastscripts.nix (100%) rename modules/darwin/{ => programs}/popclip.nix (100%) rename modules/darwin/{ => programs}/scroll-reverser.nix (100%) create mode 100644 modules/darwin/system/default.nix rename modules/darwin/{ => system}/disable-updates.nix (100%) rename modules/darwin/{ => system}/start-on-activation.nix (100%) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index b6875eb0..4b8cdd9e 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -6,11 +6,8 @@ ... }: { imports = [ - ./disable-updates.nix - ./fastscripts.nix - ./popclip.nix - ./scroll-reverser.nix - ./start-on-activation.nix + ./programs + ./system ]; fonts.packages = [ diff --git a/modules/darwin/programs/default.nix b/modules/darwin/programs/default.nix new file mode 100644 index 00000000..4633f157 --- /dev/null +++ b/modules/darwin/programs/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./fastscripts.nix + ./popclip.nix + ./scroll-reverser.nix + ]; +} diff --git a/modules/darwin/fastscripts.nix b/modules/darwin/programs/fastscripts.nix similarity index 100% rename from modules/darwin/fastscripts.nix rename to modules/darwin/programs/fastscripts.nix diff --git a/modules/darwin/popclip.nix b/modules/darwin/programs/popclip.nix similarity index 100% rename from modules/darwin/popclip.nix rename to modules/darwin/programs/popclip.nix diff --git a/modules/darwin/scroll-reverser.nix b/modules/darwin/programs/scroll-reverser.nix similarity index 100% rename from modules/darwin/scroll-reverser.nix rename to modules/darwin/programs/scroll-reverser.nix diff --git a/modules/darwin/system/default.nix b/modules/darwin/system/default.nix new file mode 100644 index 00000000..38474371 --- /dev/null +++ b/modules/darwin/system/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./disable-updates.nix + ./start-on-activation.nix + ]; +} diff --git a/modules/darwin/disable-updates.nix b/modules/darwin/system/disable-updates.nix similarity index 100% rename from modules/darwin/disable-updates.nix rename to modules/darwin/system/disable-updates.nix diff --git a/modules/darwin/start-on-activation.nix b/modules/darwin/system/start-on-activation.nix similarity index 100% rename from modules/darwin/start-on-activation.nix rename to modules/darwin/system/start-on-activation.nix From 5391fb9ce7034b552267da2991d74aa1996f836b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:15:30 -0700 Subject: [PATCH 13/39] Add tailscale module --- modules/darwin/programs/default.nix | 1 + modules/darwin/programs/tailscale.nix | 28 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 modules/darwin/programs/tailscale.nix diff --git a/modules/darwin/programs/default.nix b/modules/darwin/programs/default.nix index 4633f157..1b8f2257 100644 --- a/modules/darwin/programs/default.nix +++ b/modules/darwin/programs/default.nix @@ -3,5 +3,6 @@ ./fastscripts.nix ./popclip.nix ./scroll-reverser.nix + ./tailscale.nix ]; } diff --git a/modules/darwin/programs/tailscale.nix b/modules/darwin/programs/tailscale.nix new file mode 100644 index 00000000..568a40d4 --- /dev/null +++ b/modules/darwin/programs/tailscale.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.programs.tailscale; +in { + options.programs.tailscale = { + enable = mkEnableOption "Tailscale"; + + startOnActivation = mkEnableOption "starting Tailscale on activation"; + }; + + config = mkIf cfg.enable { + homebrew.casks = [ + { + name = "tailscale-app"; + greedy = true; + } + ]; + system.disableUpdates = ["io.tailscale.ipn.macsys"]; + system.startOnActivation = mkIf cfg.startOnActivation { + "Tailscale" = "/Applications/Tailscale.app/"; + }; + }; +} From c09c52615bb09217608365d2c9c2c68e561535ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:17:13 -0700 Subject: [PATCH 14/39] Enable tailscale via module --- modules/darwin/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 4b8cdd9e..34aaca22 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -34,7 +34,6 @@ "nova" "postico" "roon" - "tailscale-app" ]; otherApps = [ "legcord" @@ -94,6 +93,11 @@ startOnActivation = true; }; + programs.tailscale = { + enable = true; + startOnActivation = true; + }; + security.pam.services.sudo_local = { reattach = true; touchIdAuth = true; @@ -106,7 +110,6 @@ "com.lukilabs.lukiapp" # Craft "com.panic.Nova" "com.rogueamoeba.soundsource" - "io.tailscale.ipn.macsys" "org.sbarex.QLMarkdown" { domain = "at.obdev.littlesnitch.softwareupdate"; @@ -117,7 +120,6 @@ system.startOnActivation = { "Hand Mirror" = "/Applications/Hand\ Mirror.app/"; "SoundSource" = "${pkgs.soundsource}/Applications/SoundSource.app/"; - "Tailscale" = "/Applications/Tailscale.app/"; }; system.defaults = { From dad5be7321f8dcd5c9f34f8c43c002cfa59819ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:20:35 -0700 Subject: [PATCH 15/39] Add Craft module --- modules/darwin/programs/craft.nix | 28 ++++++++++++++++++++++++++++ modules/darwin/programs/default.nix | 1 + 2 files changed, 29 insertions(+) create mode 100644 modules/darwin/programs/craft.nix diff --git a/modules/darwin/programs/craft.nix b/modules/darwin/programs/craft.nix new file mode 100644 index 00000000..e3be2002 --- /dev/null +++ b/modules/darwin/programs/craft.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.programs.craft; +in { + options.programs.craft = { + enable = mkEnableOption "Craft"; + + startOnActivation = mkEnableOption "starting Craft on activation"; + }; + + config = mkIf cfg.enable { + homebrew.casks = [ + { + name = "craft"; + greedy = true; + } + ]; + system.disableUpdates = ["com.lukilabs.lukiapp"]; + system.startOnActivation = mkIf cfg.startOnActivation { + "Craft" = "/Applications/Craft.app/"; + }; + }; +} diff --git a/modules/darwin/programs/default.nix b/modules/darwin/programs/default.nix index 1b8f2257..da5beead 100644 --- a/modules/darwin/programs/default.nix +++ b/modules/darwin/programs/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./craft.nix ./fastscripts.nix ./popclip.nix ./scroll-reverser.nix From 5903cce5aad844706daf498685e5f3f04e04afdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:20:49 -0700 Subject: [PATCH 16/39] Enable craft via module --- modules/darwin/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 34aaca22..beac4b01 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -30,7 +30,6 @@ inherit name; greedy = true; }) [ - "craft" "nova" "postico" "roon" @@ -70,6 +69,10 @@ }; }; + programs.craft = { + enable = true; + }; + programs.fastscripts = { enable = true; userScripts = { @@ -107,7 +110,6 @@ "at.eggerapps.Postico" "com.colliderli.iina" "com.daisydiskapp.DaisyDiskStandAlone" - "com.lukilabs.lukiapp" # Craft "com.panic.Nova" "com.rogueamoeba.soundsource" "org.sbarex.QLMarkdown" From 05f88d4a4bb3530cfcdb4bf949cc3b716c656a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:23:14 -0700 Subject: [PATCH 17/39] Add Nova module --- modules/darwin/programs/default.nix | 1 + modules/darwin/programs/nova-editor.nix | 28 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 modules/darwin/programs/nova-editor.nix diff --git a/modules/darwin/programs/default.nix b/modules/darwin/programs/default.nix index da5beead..fda59e29 100644 --- a/modules/darwin/programs/default.nix +++ b/modules/darwin/programs/default.nix @@ -2,6 +2,7 @@ imports = [ ./craft.nix ./fastscripts.nix + ./nova-editor.nix ./popclip.nix ./scroll-reverser.nix ./tailscale.nix diff --git a/modules/darwin/programs/nova-editor.nix b/modules/darwin/programs/nova-editor.nix new file mode 100644 index 00000000..4dccb8a0 --- /dev/null +++ b/modules/darwin/programs/nova-editor.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.programs.nova-editor; +in { + options.programs.nova-editor = { + enable = mkEnableOption "Nova"; + + startOnActivation = mkEnableOption "starting Nova on activation"; + }; + + config = mkIf cfg.enable { + homebrew.casks = [ + { + name = "nova"; + greedy = true; + } + ]; + system.disableUpdates = ["com.panic.Nova"]; + system.startOnActivation = mkIf cfg.startOnActivation { + "Nova" = "/Applications/Nova.app/"; + }; + }; +} From bbf930a0c34c12c05abf0fce521d7d6d130a2aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:23:25 -0700 Subject: [PATCH 18/39] Enable Nova via module --- modules/darwin/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index beac4b01..24bac75c 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -30,7 +30,6 @@ inherit name; greedy = true; }) [ - "nova" "postico" "roon" ]; @@ -85,6 +84,10 @@ startOnActivation = true; }; + programs.nova-editor = { + enable = true; + }; + # TODO: Ideally this would be in a Darwin-specific home-manager module programs.popclip = { enable = true; @@ -110,7 +113,6 @@ "at.eggerapps.Postico" "com.colliderli.iina" "com.daisydiskapp.DaisyDiskStandAlone" - "com.panic.Nova" "com.rogueamoeba.soundsource" "org.sbarex.QLMarkdown" { From f68277f207864a3c447313d63daad8ed4e24a801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:26:33 -0700 Subject: [PATCH 19/39] Add Postico module --- modules/darwin/programs/default.nix | 1 + modules/darwin/programs/postico.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 modules/darwin/programs/postico.nix diff --git a/modules/darwin/programs/default.nix b/modules/darwin/programs/default.nix index fda59e29..b128b606 100644 --- a/modules/darwin/programs/default.nix +++ b/modules/darwin/programs/default.nix @@ -4,6 +4,7 @@ ./fastscripts.nix ./nova-editor.nix ./popclip.nix + ./postico.nix ./scroll-reverser.nix ./tailscale.nix ]; diff --git a/modules/darwin/programs/postico.nix b/modules/darwin/programs/postico.nix new file mode 100644 index 00000000..0f65a057 --- /dev/null +++ b/modules/darwin/programs/postico.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.programs.postico; +in { + options.programs.postico = { + enable = mkEnableOption "Postico"; + + startOnActivation = mkEnableOption "starting Postico on activation"; + }; + + config = mkIf cfg.enable { + homebrew.casks = [ + { + name = "postico"; + greedy = true; + } + ]; + system.disableUpdates = ["at.eggerapps.Postico"]; + system.startOnActivation = mkIf cfg.startOnActivation { + "Postico" = "/Applications/Postico\ 2.app/"; + }; + }; +} From fc34ebdebb90c0b3394db1146ae58c84bd55dc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:26:39 -0700 Subject: [PATCH 20/39] Enable Postico via module --- modules/darwin/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 24bac75c..2621843b 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -30,7 +30,6 @@ inherit name; greedy = true; }) [ - "postico" "roon" ]; otherApps = [ @@ -94,6 +93,10 @@ startOnActivation = true; }; + programs.postico = { + enable = true; + }; + programs.scroll-reverser = { enable = true; startOnActivation = true; @@ -110,7 +113,6 @@ }; system.disableUpdates = [ - "at.eggerapps.Postico" "com.colliderli.iina" "com.daisydiskapp.DaisyDiskStandAlone" "com.rogueamoeba.soundsource" From 5c32748f098b63577a76f68be15f18d503472b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:29:30 -0700 Subject: [PATCH 21/39] Add Roon module --- modules/darwin/programs/default.nix | 1 + modules/darwin/programs/roon.nix | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 modules/darwin/programs/roon.nix diff --git a/modules/darwin/programs/default.nix b/modules/darwin/programs/default.nix index b128b606..89d4065f 100644 --- a/modules/darwin/programs/default.nix +++ b/modules/darwin/programs/default.nix @@ -5,6 +5,7 @@ ./nova-editor.nix ./popclip.nix ./postico.nix + ./roon.nix ./scroll-reverser.nix ./tailscale.nix ]; diff --git a/modules/darwin/programs/roon.nix b/modules/darwin/programs/roon.nix new file mode 100644 index 00000000..1f916ec5 --- /dev/null +++ b/modules/darwin/programs/roon.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.programs.roon; +in { + options.programs.roon = { + enable = mkEnableOption "Roon client"; + + startOnActivation = mkEnableOption "starting Roon on activation"; + }; + + config = mkIf cfg.enable { + homebrew.casks = [ + { + name = "roon"; + greedy = true; + } + ]; + system.startOnActivation = mkIf cfg.startOnActivation { + "Roon" = "/Applications/Roon.app/"; + }; + }; +} From c05e48f703f4cc466954499b7e8d52313b83b4ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Fri, 17 Oct 2025 15:29:45 -0700 Subject: [PATCH 22/39] Enable Roon via module and simplify casks --- modules/darwin/default.nix | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 2621843b..4341c41e 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -24,24 +24,11 @@ taps = builtins.attrNames config.nix-homebrew.taps; # See: zhaofengli/nix-homebrew#5 # N.B.: Apps marked auto_updates will not be updated by homebrew. These apps should # have their updates disabled and then marked `greedy` to force homebrew to update. - casks = let - greedyApps = - map (name: { - inherit name; - greedy = true; - }) [ - "roon" - ]; - otherApps = [ - "legcord" - "plex" # auto_updates - "textual" - ]; - in - lib.concatLists [ - greedyApps - otherApps - ]; + casks = [ + "legcord" + "plex" # auto_updates + "textual" + ]; # N.B.: Removed entries in `masApps` require manual uninstallation masApps = { "Copilot" = 1447330651; @@ -97,6 +84,10 @@ enable = true; }; + programs.roon = { + enable = true; + }; + programs.scroll-reverser = { enable = true; startOnActivation = true; From b6b4f491a06e3bffdd25eaef98476b293d31f999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Mon, 20 Oct 2025 17:20:13 -0700 Subject: [PATCH 23/39] Add SoundSource module --- modules/darwin/programs/default.nix | 1 + modules/darwin/programs/soundsource.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 modules/darwin/programs/soundsource.nix diff --git a/modules/darwin/programs/default.nix b/modules/darwin/programs/default.nix index 89d4065f..7460595d 100644 --- a/modules/darwin/programs/default.nix +++ b/modules/darwin/programs/default.nix @@ -7,6 +7,7 @@ ./postico.nix ./roon.nix ./scroll-reverser.nix + ./soundsource.nix ./tailscale.nix ]; } diff --git a/modules/darwin/programs/soundsource.nix b/modules/darwin/programs/soundsource.nix new file mode 100644 index 00000000..35e005a4 --- /dev/null +++ b/modules/darwin/programs/soundsource.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.programs.soundsource; +in { + options.programs.soundsource = { + enable = mkEnableOption "SoundSource"; + + startOnActivation = mkEnableOption "starting SoundSource on activation"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = [pkgs.soundsource]; + system.disableUpdates = ["com.rogueamoeba.soundsource"]; + system.startOnActivation = mkIf cfg.startOnActivation { + "SoundSource" = "${pkgs.soundsource}/Applications/SoundSource.app/"; + }; + }; +} From d5f07cef390df9dcc68b8ed620b880b00ddad05c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Mon, 20 Oct 2025 17:20:27 -0700 Subject: [PATCH 24/39] Enable SoundSource via module --- home/default.nix | 1 - modules/darwin/default.nix | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/home/default.nix b/home/default.nix index 9db75b97..152bba89 100644 --- a/home/default.nix +++ b/home/default.nix @@ -63,7 +63,6 @@ mas mochi slack - soundsource the-unarchiver whatsapp-for-mac zoom-us diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 4341c41e..1eda7800 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -93,6 +93,11 @@ startOnActivation = true; }; + programs.soundsource = { + enable = true; + startOnActivation = true; + }; + programs.tailscale = { enable = true; startOnActivation = true; @@ -106,7 +111,6 @@ system.disableUpdates = [ "com.colliderli.iina" "com.daisydiskapp.DaisyDiskStandAlone" - "com.rogueamoeba.soundsource" "org.sbarex.QLMarkdown" { domain = "at.obdev.littlesnitch.softwareupdate"; @@ -116,7 +120,6 @@ system.startOnActivation = { "Hand Mirror" = "/Applications/Hand\ Mirror.app/"; - "SoundSource" = "${pkgs.soundsource}/Applications/SoundSource.app/"; }; system.defaults = { From 04aacaa4887d218e9380a5d535d472c9a7cd53ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Mon, 20 Oct 2025 17:54:15 -0700 Subject: [PATCH 25/39] Enable packages through home-manager --- modules/darwin/programs/fastscripts.nix | 3 ++- modules/darwin/programs/scroll-reverser.nix | 3 ++- modules/darwin/programs/soundsource.nix | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/darwin/programs/fastscripts.nix b/modules/darwin/programs/fastscripts.nix index 9b488fe7..7d5e475d 100644 --- a/modules/darwin/programs/fastscripts.nix +++ b/modules/darwin/programs/fastscripts.nix @@ -3,6 +3,7 @@ lib, pkgs, nixDarwin, + username, ... }: with lib; let @@ -53,7 +54,7 @@ in { }; config = mkIf cfg.enable { - environment.systemPackages = [pkgs.fastscripts]; + home-manager.users.${username}.home.packages = [pkgs.fastscripts]; system.build.fastscripts = pkgs.runCommand "fastscripts" {preferLocalBuild = true;} diff --git a/modules/darwin/programs/scroll-reverser.nix b/modules/darwin/programs/scroll-reverser.nix index 9e58c615..2b6cb956 100644 --- a/modules/darwin/programs/scroll-reverser.nix +++ b/modules/darwin/programs/scroll-reverser.nix @@ -2,6 +2,7 @@ config, lib, pkgs, + username, ... }: with lib; let @@ -14,7 +15,7 @@ in { }; config = mkIf cfg.enable { - environment.systemPackages = [pkgs.scroll-reverser]; + home-manager.users.${username}.home.packages = [pkgs.scroll-reverser]; system.defaults.CustomUserPreferences = { "com.pilotmoon.scroll-reverser" = { InvertScrollingOn = true; diff --git a/modules/darwin/programs/soundsource.nix b/modules/darwin/programs/soundsource.nix index 35e005a4..33bdd496 100644 --- a/modules/darwin/programs/soundsource.nix +++ b/modules/darwin/programs/soundsource.nix @@ -2,6 +2,7 @@ config, lib, pkgs, + username, ... }: with lib; let @@ -14,7 +15,7 @@ in { }; config = mkIf cfg.enable { - environment.systemPackages = [pkgs.soundsource]; + home-manager.users.${username}.home.packages = [pkgs.soundsource]; system.disableUpdates = ["com.rogueamoeba.soundsource"]; system.startOnActivation = mkIf cfg.startOnActivation { "SoundSource" = "${pkgs.soundsource}/Applications/SoundSource.app/"; From 8baaa5736403098a44a581295b326ca53ed898c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Mon, 20 Oct 2025 17:54:41 -0700 Subject: [PATCH 26/39] Remove TODO --- modules/darwin/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 1eda7800..be75ad9f 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -74,7 +74,6 @@ enable = true; }; - # TODO: Ideally this would be in a Darwin-specific home-manager module programs.popclip = { enable = true; startOnActivation = true; From b8645383e2e5d1d1e443a46e2ad9a10cbbffbf22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Mon, 20 Oct 2025 18:01:44 -0700 Subject: [PATCH 27/39] Remove note --- modules/darwin/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index be75ad9f..1d68687b 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -22,11 +22,9 @@ upgrade = true; }; taps = builtins.attrNames config.nix-homebrew.taps; # See: zhaofengli/nix-homebrew#5 - # N.B.: Apps marked auto_updates will not be updated by homebrew. These apps should - # have their updates disabled and then marked `greedy` to force homebrew to update. casks = [ "legcord" - "plex" # auto_updates + "plex" "textual" ]; # N.B.: Removed entries in `masApps` require manual uninstallation From 7ff29ca047a74308ebab1934ba23524a4c9e072e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Mon, 20 Oct 2025 18:12:48 -0700 Subject: [PATCH 28/39] Move darwin home packages into module --- home/default.nix | 18 +----------------- modules/darwin/default.nix | 5 +++++ modules/darwin/home.nix | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 modules/darwin/home.nix diff --git a/home/default.nix b/home/default.nix index 152bba89..e7bffee1 100644 --- a/home/default.nix +++ b/home/default.nix @@ -52,28 +52,12 @@ unzip ]; guiApps = [cinny-desktop code-cursor]; - darwinApps = [ - chatgpt - claude-desktop - daisydisk - github-desktop - gitify - iina - m-cli - mas - mochi - slack - the-unarchiver - whatsapp-for-mac - zoom-us - ]; in development ++ nixSpecific ++ tuiApps ++ utilities - ++ lib.optionals enableGuiPackages guiApps - ++ lib.optionals stdenv.isDarwin darwinApps; + ++ lib.optionals enableGuiPackages guiApps; home.sessionPath = [ "$HOME/.local/bin" ]; diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 1d68687b..71953c33 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -3,6 +3,7 @@ config, pkgs, lib, + username, ... }: { imports = [ @@ -14,6 +15,10 @@ pkgs.nerd-fonts.meslo-lg # Supplies MesloLGSDZ: Line Gap Small, Dotted Zero ]; + home-manager.users.${username} = {...}: { + imports = [./home.nix]; + }; + homebrew = { enable = true; caskArgs.no_quarantine = true; diff --git a/modules/darwin/home.nix b/modules/darwin/home.nix new file mode 100644 index 00000000..7fd32a6d --- /dev/null +++ b/modules/darwin/home.nix @@ -0,0 +1,23 @@ +{ + self, + config, + pkgs, + lib, + ... +}: { + home.packages = with pkgs; [ + chatgpt + claude-desktop + daisydisk + github-desktop + gitify + iina + m-cli + mas + mochi + slack + the-unarchiver + whatsapp-for-mac + zoom-us + ]; +} From 227083ff9d2836ec3cbc9acd36b10565a3c21329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Tue, 21 Oct 2025 13:11:44 -0700 Subject: [PATCH 29/39] Add iina module --- modules/darwin/programs/default.nix | 1 + modules/darwin/programs/iina.nix | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 modules/darwin/programs/iina.nix diff --git a/modules/darwin/programs/default.nix b/modules/darwin/programs/default.nix index 7460595d..363e5e78 100644 --- a/modules/darwin/programs/default.nix +++ b/modules/darwin/programs/default.nix @@ -2,6 +2,7 @@ imports = [ ./craft.nix ./fastscripts.nix + ./iina.nix ./nova-editor.nix ./popclip.nix ./postico.nix diff --git a/modules/darwin/programs/iina.nix b/modules/darwin/programs/iina.nix new file mode 100644 index 00000000..6472672b --- /dev/null +++ b/modules/darwin/programs/iina.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + pkgs, + username, + ... +}: +with lib; let + cfg = config.programs.iina; +in { + options.programs.iina = { + enable = mkEnableOption "iina"; + }; + + config = mkIf cfg.enable { + home-manager.users.${username}.home.packages = [pkgs.iina]; + system.disableUpdates = ["com.colliderli.iina"]; + }; +} From f5d33ea528448c6cd6283252c730ce2c0f5de9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Tue, 21 Oct 2025 13:11:57 -0700 Subject: [PATCH 30/39] Enable iina via module --- modules/darwin/default.nix | 5 ++++- modules/darwin/home.nix | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 71953c33..5b117376 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -73,6 +73,10 @@ startOnActivation = true; }; + programs.iina = { + enable = true; + }; + programs.nova-editor = { enable = true; }; @@ -111,7 +115,6 @@ }; system.disableUpdates = [ - "com.colliderli.iina" "com.daisydiskapp.DaisyDiskStandAlone" "org.sbarex.QLMarkdown" { diff --git a/modules/darwin/home.nix b/modules/darwin/home.nix index 7fd32a6d..e5e75a3a 100644 --- a/modules/darwin/home.nix +++ b/modules/darwin/home.nix @@ -11,7 +11,6 @@ daisydisk github-desktop gitify - iina m-cli mas mochi From 766cf5a2db7e5695a70fd1e6c8fc23e41bdde0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Tue, 21 Oct 2025 13:12:26 -0700 Subject: [PATCH 31/39] Remove Hand Mirror from `startOnActivation` --- modules/darwin/default.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 5b117376..8e81cd01 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -123,10 +123,6 @@ } ]; - system.startOnActivation = { - "Hand Mirror" = "/Applications/Hand\ Mirror.app/"; - }; - system.defaults = { ".GlobalPreferences"."com.apple.mouse.scaling" = 1.5; LaunchServices.LSQuarantine = false; From 7725652a9d7c28f5860c05f8cde4fc7ec5b33ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Tue, 21 Oct 2025 13:15:05 -0700 Subject: [PATCH 32/39] Add DaisyDisk module --- modules/darwin/programs/daisydisk.nix | 19 +++++++++++++++++++ modules/darwin/programs/default.nix | 1 + 2 files changed, 20 insertions(+) create mode 100644 modules/darwin/programs/daisydisk.nix diff --git a/modules/darwin/programs/daisydisk.nix b/modules/darwin/programs/daisydisk.nix new file mode 100644 index 00000000..de98596a --- /dev/null +++ b/modules/darwin/programs/daisydisk.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + pkgs, + username, + ... +}: +with lib; let + cfg = config.programs.daisydisk; +in { + options.programs.daisydisk = { + enable = mkEnableOption "DaisyDisk"; + }; + + config = mkIf cfg.enable { + home-manager.users.${username}.home.packages = [pkgs.daisydisk]; + system.disableUpdates = ["com.daisydiskapp.DaisyDiskStandAlone"]; + }; +} diff --git a/modules/darwin/programs/default.nix b/modules/darwin/programs/default.nix index 363e5e78..58a97060 100644 --- a/modules/darwin/programs/default.nix +++ b/modules/darwin/programs/default.nix @@ -1,6 +1,7 @@ { imports = [ ./craft.nix + ./daisydisk.nix ./fastscripts.nix ./iina.nix ./nova-editor.nix From bff9a858fabb6b1f86f9549b4891622c6a3de216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Tue, 21 Oct 2025 13:15:13 -0700 Subject: [PATCH 33/39] Enable DaisyDisk via module --- modules/darwin/default.nix | 5 ++++- modules/darwin/home.nix | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 8e81cd01..7ba532c9 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -61,6 +61,10 @@ enable = true; }; + programs.daisydisk = { + enable = true; + }; + programs.fastscripts = { enable = true; userScripts = { @@ -115,7 +119,6 @@ }; system.disableUpdates = [ - "com.daisydiskapp.DaisyDiskStandAlone" "org.sbarex.QLMarkdown" { domain = "at.obdev.littlesnitch.softwareupdate"; diff --git a/modules/darwin/home.nix b/modules/darwin/home.nix index e5e75a3a..363be09a 100644 --- a/modules/darwin/home.nix +++ b/modules/darwin/home.nix @@ -8,7 +8,6 @@ home.packages = with pkgs; [ chatgpt claude-desktop - daisydisk github-desktop gitify m-cli From 08045074dbef355790b6beb0050a11a043be43d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Tue, 21 Oct 2025 13:22:30 -0700 Subject: [PATCH 34/39] Move programs into host module --- hosts/Rhizome/default.nix | 1 + hosts/Rhizome/programs.nix | 94 ++++++++++++++++++++++++++++++++++++++ modules/darwin/default.nix | 83 --------------------------------- 3 files changed, 95 insertions(+), 83 deletions(-) create mode 100644 hosts/Rhizome/programs.nix diff --git a/hosts/Rhizome/default.nix b/hosts/Rhizome/default.nix index 2f43656e..ebc03d08 100644 --- a/hosts/Rhizome/default.nix +++ b/hosts/Rhizome/default.nix @@ -6,5 +6,6 @@ imports = [ ./dock.nix ./hardware.nix + ./programs.nix ]; } diff --git a/hosts/Rhizome/programs.nix b/hosts/Rhizome/programs.nix new file mode 100644 index 00000000..127879fd --- /dev/null +++ b/hosts/Rhizome/programs.nix @@ -0,0 +1,94 @@ +{ + config, + pkgs, + ... +}: { + homebrew = { + enable = true; + casks = [ + "legcord" + "plex" + "textual" + ]; + # N.B.: Removed entries in `masApps` require manual uninstallation + masApps = { + "Copilot" = 1447330651; + "Folder Quick Look" = 6753110395; + "GoodLinks" = 1474335294; + "Hand Mirror" = 1502839586; + "Hush" = 1544743900; + "Mapper" = 1589391989; + "Mela" = 1568924476; + "MusicBox" = 1614730313; + "Numbers" = 409203825; + "Noir" = 1592917505; + "Pages" = 409201541; + "Paku" = 1534130193; + "Parcel" = 375589283; + "Pixea" = 1507782672; + "Play" = 1596506190; + "Prompt" = 1594420480; + "Reeder" = 1529448980; + "Timery" = 1425368544; + "Things" = 904280696; + "Wipr" = 1320666476; + }; + }; + + programs.craft = { + enable = true; + }; + + programs.daisydisk = { + enable = true; + }; + + programs.fastscripts = { + enable = true; + startOnActivation = true; + }; + + programs.iina = { + enable = true; + }; + + programs.nova-editor = { + enable = true; + }; + + programs.popclip = { + enable = true; + startOnActivation = true; + }; + + programs.postico = { + enable = true; + }; + + programs.roon = { + enable = true; + }; + + programs.scroll-reverser = { + enable = true; + startOnActivation = true; + }; + + programs.soundsource = { + enable = true; + startOnActivation = true; + }; + + programs.tailscale = { + enable = true; + startOnActivation = true; + }; + + system.disableUpdates = [ + "org.sbarex.QLMarkdown" + { + domain = "at.obdev.littlesnitch.softwareupdate"; + keys = ["SoftwareUpdateCheckAutomatically"]; + } + ]; +} diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 7ba532c9..3f9d96eb 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -20,53 +20,15 @@ }; homebrew = { - enable = true; caskArgs.no_quarantine = true; onActivation = { cleanup = "zap"; upgrade = true; }; taps = builtins.attrNames config.nix-homebrew.taps; # See: zhaofengli/nix-homebrew#5 - casks = [ - "legcord" - "plex" - "textual" - ]; - # N.B.: Removed entries in `masApps` require manual uninstallation - masApps = { - "Copilot" = 1447330651; - "Folder Quick Look" = 6753110395; - "GoodLinks" = 1474335294; - "Hand Mirror" = 1502839586; - "Hush" = 1544743900; - "Mapper" = 1589391989; - "Mela" = 1568924476; - "MusicBox" = 1614730313; - "Numbers" = 409203825; - "Noir" = 1592917505; - "Pages" = 409201541; - "Paku" = 1534130193; - "Parcel" = 375589283; - "Pixea" = 1507782672; - "Play" = 1596506190; - "Prompt" = 1594420480; - "Reeder" = 1529448980; - "Timery" = 1425368544; - "Things" = 904280696; - "Wipr" = 1320666476; - }; - }; - - programs.craft = { - enable = true; - }; - - programs.daisydisk = { - enable = true; }; programs.fastscripts = { - enable = true; userScripts = { SafariQuitWithConfirmation = { source = pkgs.writeText "safari-quit-with-confirmation.applescript" (builtins.readFile ./fastscripts/safari-quit-with-confirmation.applescript); @@ -74,43 +36,6 @@ }; }; plistFile = pkgs.writeText "fastscripts-keybindings.plist" (builtins.readFile ./fastscripts/keybindings.plist); - startOnActivation = true; - }; - - programs.iina = { - enable = true; - }; - - programs.nova-editor = { - enable = true; - }; - - programs.popclip = { - enable = true; - startOnActivation = true; - }; - - programs.postico = { - enable = true; - }; - - programs.roon = { - enable = true; - }; - - programs.scroll-reverser = { - enable = true; - startOnActivation = true; - }; - - programs.soundsource = { - enable = true; - startOnActivation = true; - }; - - programs.tailscale = { - enable = true; - startOnActivation = true; }; security.pam.services.sudo_local = { @@ -118,14 +43,6 @@ touchIdAuth = true; }; - system.disableUpdates = [ - "org.sbarex.QLMarkdown" - { - domain = "at.obdev.littlesnitch.softwareupdate"; - keys = ["SoftwareUpdateCheckAutomatically"]; - } - ]; - system.defaults = { ".GlobalPreferences"."com.apple.mouse.scaling" = 1.5; LaunchServices.LSQuarantine = false; From 43be20828e015764d2ecaa4f0155f1a4cac27031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Tue, 21 Oct 2025 13:27:01 -0700 Subject: [PATCH 35/39] Add little-snitch module --- modules/darwin/programs/default.nix | 1 + modules/darwin/programs/little-snitch.nix | 28 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 modules/darwin/programs/little-snitch.nix diff --git a/modules/darwin/programs/default.nix b/modules/darwin/programs/default.nix index 58a97060..79628486 100644 --- a/modules/darwin/programs/default.nix +++ b/modules/darwin/programs/default.nix @@ -4,6 +4,7 @@ ./daisydisk.nix ./fastscripts.nix ./iina.nix + ./little-snitch.nix ./nova-editor.nix ./popclip.nix ./postico.nix diff --git a/modules/darwin/programs/little-snitch.nix b/modules/darwin/programs/little-snitch.nix new file mode 100644 index 00000000..40d903d2 --- /dev/null +++ b/modules/darwin/programs/little-snitch.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.programs.little-snitch; +in { + options.programs.little-snitch = { + enable = mkEnableOption "Little Snitch"; + }; + + config = mkIf cfg.enable { + homebrew.casks = [ + { + name = "little-snitch"; + greedy = true; + } + ]; + system.disableUpdates = [ + { + domain = "at.obdev.littlesnitch.softwareupdate"; + keys = ["SoftwareUpdateCheckAutomatically"]; + } + ]; + }; +} From b9a7b1cf1fb4483384566b102ca481ad5a4b3f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Tue, 21 Oct 2025 13:27:14 -0700 Subject: [PATCH 36/39] Enable little-snitch --- hosts/Rhizome/programs.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hosts/Rhizome/programs.nix b/hosts/Rhizome/programs.nix index 127879fd..b96b8b48 100644 --- a/hosts/Rhizome/programs.nix +++ b/hosts/Rhizome/programs.nix @@ -52,6 +52,10 @@ enable = true; }; + programs.little-snitch = { + enable = true; + }; + programs.nova-editor = { enable = true; }; @@ -86,9 +90,5 @@ system.disableUpdates = [ "org.sbarex.QLMarkdown" - { - domain = "at.obdev.littlesnitch.softwareupdate"; - keys = ["SoftwareUpdateCheckAutomatically"]; - } ]; } From d56a4f8c07771a73da953b37fed0ccacda356f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Tue, 21 Oct 2025 13:27:33 -0700 Subject: [PATCH 37/39] Remove deprecated QLMarkdown --- hosts/Rhizome/programs.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hosts/Rhizome/programs.nix b/hosts/Rhizome/programs.nix index b96b8b48..b74abbd5 100644 --- a/hosts/Rhizome/programs.nix +++ b/hosts/Rhizome/programs.nix @@ -87,8 +87,4 @@ enable = true; startOnActivation = true; }; - - system.disableUpdates = [ - "org.sbarex.QLMarkdown" - ]; } From 450f74ab5d7efe516cbe552bc978b00099a741e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Tue, 21 Oct 2025 14:54:08 -0700 Subject: [PATCH 38/39] `rc.darwin.defaults` module --- modules/darwin/rc.nix | 133 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 modules/darwin/rc.nix diff --git a/modules/darwin/rc.nix b/modules/darwin/rc.nix new file mode 100644 index 00000000..f5c61a55 --- /dev/null +++ b/modules/darwin/rc.nix @@ -0,0 +1,133 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.rc.darwin.defaults; +in { + options.rc.darwin.defaults = { + fonts = mkEnableOption "Font defaults"; + + homebrew = mkEnableOption "Homebrew defaults"; + + fastscripts = mkEnableOption "FastScripts default userscripts"; + + security = mkEnableOption "Security defaults"; + + system = mkEnableOption "System defaults"; + }; + + config = { + fonts.packages = mkIf cfg.fonts [ + pkgs.nerd-fonts.meslo-lg # Supplies MesloLGSDZ: Line Gap Small, Dotted Zero + ]; + + homebrew = mkIf cfg.homebrew { + caskArgs.no_quarantine = true; + onActivation = { + cleanup = "zap"; + upgrade = true; + }; + taps = builtins.attrNames config.nix-homebrew.taps; # See: zhaofengli/nix-homebrew#5 + }; + + programs.fastscripts = mkIf cfg.fastscripts { + userScripts = { + SafariQuitWithConfirmation = { + source = pkgs.writeText "safari-quit-with-confirmation.applescript" (builtins.readFile ./fastscripts/safari-quit-with-confirmation.applescript); + target = "Applications/Safari/Quit With Confirmation.applescript"; + }; + }; + plistFile = pkgs.writeText "fastscripts-keybindings.plist" (builtins.readFile ./fastscripts/keybindings.plist); + }; + + security.pam.services.sudo_local = mkIf cfg.security { + reattach = true; + touchIdAuth = true; + }; + + system.defaults = mkIf cfg.system { + ".GlobalPreferences"."com.apple.mouse.scaling" = 1.5; + LaunchServices.LSQuarantine = false; + NSGlobalDomain = { + AppleScrollerPagingBehavior = true; # Jump to spot on scroll bar when clicked + NSAutomaticCapitalizationEnabled = false; + NSAutomaticDashSubstitutionEnabled = false; + NSAutomaticPeriodSubstitutionEnabled = false; + NSAutomaticQuoteSubstitutionEnabled = false; # Disable smart quoting + NSAutomaticSpellingCorrectionEnabled = false; + "com.apple.springing.enabled" = true; + "com.apple.springing.delay" = 0.5; + # "com.apple.trackpad.forceClick" = 1; # TODO + "com.apple.trackpad.scaling" = 1.0; + + # Always use expanded save panel + NSNavPanelExpandedStateForSaveMode = true; + NSNavPanelExpandedStateForSaveMode2 = true; + + # Quickly repeat keys when held + InitialKeyRepeat = 15; + KeyRepeat = 2; + }; + # TODO: + # showAppExposeGestureEnabled = 1; + # showMissionControlGestureEnabled = 1; + dock = { + appswitcher-all-displays = false; + autohide = false; + mineffect = "scale"; + minimize-to-application = false; + mru-spaces = false; + orientation = "bottom"; + show-process-indicators = false; + showhidden = false; + show-recents = false; + static-only = false; + magnification = true; + + # Disable hot corners + wvous-tl-corner = 1; + wvous-bl-corner = 1; + wvous-tr-corner = 1; + wvous-br-corner = 1; + }; + finder = { + AppleShowAllFiles = false; + ShowStatusBar = false; + ShowPathbar = false; + FXDefaultSearchScope = "SCcf"; # Search current folder first when searching + FXPreferredViewStyle = "Nlsv"; # Prefer list view + AppleShowAllExtensions = true; + FXEnableExtensionChangeWarning = false; # Do not warn when changing file extensions + }; + menuExtraClock = { + ShowAMPM = true; + ShowDayOfWeek = false; + ShowDate = 0; # Show full date + }; + screencapture.location = "~/Downloads"; + trackpad = { + Clicking = true; # tap to click + Dragging = true; # tap to drag + TrackpadThreeFingerDrag = true; + }; + + CustomUserPreferences = { + "com.apple.desktopservices" = { + DSDontWriteNetworkStores = true; + }; + + # N.B.: Terminal requires Full Disk Access to apply Safari defaults + "com.apple.Safari" = { + AutoOpenSafeDownloads = false; # Prevent opening "safe" files automatically + ShowFullURLInSmartSearchField = false; + "ShowFavoritesBar-v2" = false; + IncludeDevelopMenu = true; + WebKitDeveloperExtrasEnabledPreferenceKey = true; + }; + }; + }; + }; +} From 14957d651195c8a50e0dd9dc3d7001533b362fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Tue, 21 Oct 2025 14:54:52 -0700 Subject: [PATCH 39/39] Use `rc.darwin.defaults` --- hosts/Rhizome/default.nix | 7 +++ hosts/Rhizome/programs.nix | 1 + modules/darwin/default.nix | 111 +------------------------------------ 3 files changed, 9 insertions(+), 110 deletions(-) diff --git a/hosts/Rhizome/default.nix b/hosts/Rhizome/default.nix index ebc03d08..3a33cae5 100644 --- a/hosts/Rhizome/default.nix +++ b/hosts/Rhizome/default.nix @@ -8,4 +8,11 @@ ./hardware.nix ./programs.nix ]; + + rc.darwin.defaults = { + fonts = true; + homebrew = true; + security = true; + system = true; + }; } diff --git a/hosts/Rhizome/programs.nix b/hosts/Rhizome/programs.nix index b74abbd5..47f7eecf 100644 --- a/hosts/Rhizome/programs.nix +++ b/hosts/Rhizome/programs.nix @@ -47,6 +47,7 @@ enable = true; startOnActivation = true; }; + rc.darwin.defaults.fastscripts = true; programs.iina = { enable = true; diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 3f9d96eb..fa1e2c0e 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -9,122 +9,13 @@ imports = [ ./programs ./system - ]; - - fonts.packages = [ - pkgs.nerd-fonts.meslo-lg # Supplies MesloLGSDZ: Line Gap Small, Dotted Zero + ./rc.nix ]; home-manager.users.${username} = {...}: { imports = [./home.nix]; }; - homebrew = { - caskArgs.no_quarantine = true; - onActivation = { - cleanup = "zap"; - upgrade = true; - }; - taps = builtins.attrNames config.nix-homebrew.taps; # See: zhaofengli/nix-homebrew#5 - }; - - programs.fastscripts = { - userScripts = { - SafariQuitWithConfirmation = { - source = pkgs.writeText "safari-quit-with-confirmation.applescript" (builtins.readFile ./fastscripts/safari-quit-with-confirmation.applescript); - target = "Applications/Safari/Quit With Confirmation.applescript"; - }; - }; - plistFile = pkgs.writeText "fastscripts-keybindings.plist" (builtins.readFile ./fastscripts/keybindings.plist); - }; - - security.pam.services.sudo_local = { - reattach = true; - touchIdAuth = true; - }; - - system.defaults = { - ".GlobalPreferences"."com.apple.mouse.scaling" = 1.5; - LaunchServices.LSQuarantine = false; - NSGlobalDomain = { - AppleScrollerPagingBehavior = true; # Jump to spot on scroll bar when clicked - NSAutomaticCapitalizationEnabled = false; - NSAutomaticDashSubstitutionEnabled = false; - NSAutomaticPeriodSubstitutionEnabled = false; - NSAutomaticQuoteSubstitutionEnabled = false; # Disable smart quoting - NSAutomaticSpellingCorrectionEnabled = false; - "com.apple.springing.enabled" = true; - "com.apple.springing.delay" = 0.5; - # "com.apple.trackpad.forceClick" = 1; # TODO - "com.apple.trackpad.scaling" = 1.0; - - # Always use expanded save panel - NSNavPanelExpandedStateForSaveMode = true; - NSNavPanelExpandedStateForSaveMode2 = true; - - # Quickly repeat keys when held - InitialKeyRepeat = 15; - KeyRepeat = 2; - }; - # TODO: - # showAppExposeGestureEnabled = 1; - # showMissionControlGestureEnabled = 1; - dock = { - appswitcher-all-displays = false; - autohide = false; - mineffect = "scale"; - minimize-to-application = false; - mru-spaces = false; - orientation = "bottom"; - show-process-indicators = false; - showhidden = false; - show-recents = false; - static-only = false; - magnification = true; - - # Disable hot corners - wvous-tl-corner = 1; - wvous-bl-corner = 1; - wvous-tr-corner = 1; - wvous-br-corner = 1; - }; - finder = { - AppleShowAllFiles = false; - ShowStatusBar = false; - ShowPathbar = false; - FXDefaultSearchScope = "SCcf"; # Search current folder first when searching - FXPreferredViewStyle = "Nlsv"; # Prefer list view - AppleShowAllExtensions = true; - FXEnableExtensionChangeWarning = false; # Do not warn when changing file extensions - }; - menuExtraClock = { - ShowAMPM = true; - ShowDayOfWeek = false; - ShowDate = 0; # Show full date - }; - screencapture.location = "~/Downloads"; - trackpad = { - Clicking = true; # tap to click - Dragging = true; # tap to drag - TrackpadThreeFingerDrag = true; - }; - }; - - system.defaults.CustomUserPreferences = { - "com.apple.desktopservices" = { - DSDontWriteNetworkStores = true; - }; - - # N.B.: Terminal requires Full Disk Access to apply Safari defaults - "com.apple.Safari" = { - AutoOpenSafeDownloads = false; # Prevent opening "safe" files automatically - ShowFullURLInSmartSearchField = false; - "ShowFavoritesBar-v2" = false; - IncludeDevelopMenu = true; - WebKitDeveloperExtrasEnabledPreferenceKey = true; - }; - }; - system.configurationRevision = self.rev or self.dirtyRev or null; # Auto upgrade nix package and the daemon service.