nix/darwin/default.nix
2025-05-27 21:39:10 -05:00

166 lines
4.7 KiB
Nix

{
inputs,
lib,
config,
pkgs,
system,
host,
user,
...
}:
{
imports = [
./aerospace.nix
./homebrew.nix
./jankyborders.nix
./keyboard.nix
./sketchybar
./nix.nix
];
options.custom = with lib; {
shell = {
packages = mkOption {
type =
with types;
attrsOf (oneOf [
str
attrs
package
]);
apply = custom.mkShellPackages;
default = { };
description = ''
Attrset of shell packages to install and add to pkgs.custom overlay (for compatibility across multiple shells).
Both string and attr values will be passed as arguments to writeShellApplicationCompletions
'';
example = ''
shell.packages = {
myPackage1 = "echo 'Hello, World!'";
myPackage2 = {
runtimeInputs = [ pkgs.hello ];
text = "hello --greeting 'Hi'";
};
}
'';
};
};
symlinks = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Symlinks to create in the format { dest = src; }";
};
};
config = {
users.users.${user} = {
home = "/Users/${user}";
};
system.defaults = {
CustomUserPreferences = {
NSGlobalDomain = {
WebKitDeveloperExtras = true;
# AppleHighlightColor = "0.65098 0.85490 0.58431";
# AppleAccentColor = 1;
};
"com.apple.finder" = {
DisableAllAnimations = true;
ShowExternalHardDrivesOnDesktop = false;
ShowMountedServersOnDesktop = false;
ShowRemovableMediaOnDesktop = false;
ShowHardDrivesOnDesktop = false;
_FXSortFoldersFirst = true;
# search the current folder by default
FXDefaultSearchScope = "SCcf";
};
"com.apple.NetworkBrowser" = {
BrowseAllInterfaces = 1;
};
"com.apple.DesktopServices" = {
DSDontWriteNetworkStores = true;
};
# "com.apple.Safari" = {
# AutoOpenSafeDownloads = false;
# IncludeDevelopMenu = true;
# WebKitDeveloperExtrasEnabledPreferenceKey = true;
# "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" = true;
# };
# "com.apple.mail" = {
# AddressesIncludeNameOnPasteboard = false;
# };
"net.sourceforge.skim-app.skim" = {
SKPSConversionCommand = "${pkgs.custom.ps2pdfcrop}/bin/ps2pdfcrop";
};
};
screencapture = {
disable-shadow = true;
location = "/Users/${user}/Screenshots";
type = "png";
};
trackpad = {
Clicking = true;
Dragging = true;
TrackpadRightClick = true;
# TrackpadThreeFingerDrag = true;
};
dock = {
autohide = true;
expose-animation-duration = 0.0;
mineffect = "scale";
minimize-to-application = true;
mru-spaces = false;
orientation = "bottom";
show-recents = false;
wvous-br-corner = 1; # Disabled
};
finder = {
AppleShowAllExtensions = true;
FXDefaultSearchScope = "SCcf";
FXEnableExtensionChangeWarning = false;
FXPreferredViewStyle = "Nlsv";
AppleShowAllFiles = true;
_FXShowPosixPathInTitle = true;
ShowPathbar = true;
ShowStatusBar = false;
};
NSGlobalDomain = {
# AppleMeasurementUnits = "Centimeters";
AppleMetricUnits = 1;
AppleShowAllExtensions = true;
# AppleTemperatureUnit = "Celsius";
AppleInterfaceStyle = "Dark";
# AppleInterfaceStyle = null; # -- light mode
AppleInterfaceStyleSwitchesAutomatically = false;
InitialKeyRepeat = 20;
KeyRepeat = 2;
NSAutomaticCapitalizationEnabled = false;
NSAutomaticDashSubstitutionEnabled = false;
NSAutomaticPeriodSubstitutionEnabled = false;
NSAutomaticQuoteSubstitutionEnabled = false;
NSAutomaticSpellingCorrectionEnabled = false;
NSDisableAutomaticTermination = true;
NSAutomaticWindowAnimationsEnabled = false;
NSDocumentSaveNewDocumentsToCloud = false;
NSNavPanelExpandedStateForSaveMode = true;
NSNavPanelExpandedStateForSaveMode2 = true;
NSTableViewDefaultSizeMode = 2;
NSWindowResizeTime = 1.0e-4;
PMPrintingExpandedStateForPrint = true;
PMPrintingExpandedStateForPrint2 = true;
};
LaunchServices.LSQuarantine = false;
};
environment.systemPackages =
with pkgs;
[
mas
vim
htop
]
++ (lib.attrValues config.custom.shell.packages);
system.stateVersion = 6;
};
}