darwin configuration reorganization

This commit is contained in:
willemml 2023-04-11 09:28:58 -07:00
parent b38460ab89
commit cb94b8353a
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD
4 changed files with 114 additions and 75 deletions

View file

@ -23,14 +23,6 @@ in {
'';
};
home.file.".config/zsh/am.sh" = {
executable = true;
source = builtins.fetchurl {
url = "https://raw.githubusercontent.com/mcthomas/Apple-Music-CLI-Player/27353ec55abac8b5d73b8a061fb87f305c663adb/src/am.sh";
sha256 = "sha256-78zRpNg7/OR7p8dpsJt6Xc4j0Y+8zSUtm/PT94nf03M=";
};
};
programs.zsh.shellAliases =
{
drs = "darwin-rebuild switch --flake ${config.home.homeDirectory}/.config/dotfiles.nix#";
@ -62,17 +54,37 @@ in {
NSGlobalDomain = {
AppleLanguages = ["en-CA"];
AppleLocale = "en_CA";
"com.apple.sound.beep.feedback" = 1;
AppleICUForce24HourTime = true;
AppleInterfaceStyle = "Dark";
AppleMeasurementUnits = "Centimeters";
AppleMetricUnits = true;
AppleShowAllExtensions = true;
AppleShowScrollBars = "WhenScrolling";
AppleTemperatureUnit = "Celsius";
NSAutomaticCapitalizationEnabled = false;
NSAutomaticDashSubstitutionEnabled = false;
NSAutomaticPeriodSubstitutionEnabled = false;
NSAutomaticQuoteSubstitutionEnabled = false;
NSAutomaticSpellingCorrectionEnabled = false;
NSAutomaticWindowAnimationsEnabled = false;
NSDocumentSaveNewDocumentsToCloud = false;
NSNavPanelExpandedStateForSaveMode = true;
NSNavPanelExpandedStateForSaveMode2 = true;
NSTableViewDefaultSizeMode = 1;
NSTextShowsControlCharacters = true;
NSWindowResizeTime = 0.0;
};
"com.apple.Safari" = {
com.apple.Safari = {
AutoOpenSafeDownloads = false;
IncludeDevelopMenu = true;
ShowFullURLInSmartSearchField = true;
};
"com.apple.menuextra.clock" = {
com.apple.menuextra.clock = {
DateFormat = "EEE d MMM HH:mm:ss";
FlashDateSeparators = false;
};
"com.apple.controlcenter" = {
com.apple.controlcenter = {
"NSStatusItem Visible AccessibilityShortcuts" = false;
"NSStatusItem Visible AirDrop" = false;
"NSStatusItem Visible Battery" = true;
@ -87,11 +99,31 @@ in {
"NSStatusItem Visible UserSwitcher" = false;
"NSStatusItem Visible WiFi" = true;
};
"com.apple.systempreferences" = {
com.apple.systempreferences = {
"com.apple.preference.battery".hasBeenWarnedAboutEnergyUsage = true;
};
com.apple.appleseed.FeedbackAssistant.Autogather = false;
com.apple.TextEdit.RichText = false;
loginwindow = {
SHOWFULLNAME = false;
GuestEnabled = false;
DisableConsoleAccess = true;
};
LaunchServices.LSQuarantine = false;
com.apple.dock = {
autohide = true;
launchanim = false;
minimize-to-application = true;
mru-spaces = false;
orientation = "bottom";
static-only = true;
tilesize = 35;
};
com.apple.driver.AppleBluetoothMultitouch.trackpad = {
FirstClickThreshold = 0;
SecondClickThreshold = 2;
Clicking = true;
};
};
currentHostDefaults = {
"com.apple.controlcenter".BatteryShowPercentage = true;

View file

@ -0,0 +1,68 @@
{lib, ...}: {
# Global Emacs keybindings
targets.darwin.keybindings = {
"^l" = "centerSelectionInVisibleArea:";
"^/" = "undo:";
"^_" = "undo:";
"^ " = "setMark:";
"^\@" = "setMark:";
"^w" = "deleteToMark:";
"~f" = "moveWordForward:";
"~b" = "moveWordBackward:";
"~<" = "moveToBeginningOfDocument:";
"~>" = "moveToEndOfDocument:";
"~v" = "pageUp:";
"~/" = "complete:";
"~c" = [
"capitalizeWord:"
"moveForward:"
"moveForward:"
];
"~u" = [
"uppercaseWord:"
"moveForward:"
"moveForward:"
];
"~l" = [
"lowercaseWord:"
"moveForward:"
"moveForward:"
];
"~d" = "deleteWordForward:";
"^~h" = "deleteWordBackward:";
"~\U007F" = "deleteWordBackward:";
"~t" = "transposeWords:";
"~\@" = [
"setMark:"
"moveWordForward:"
"swapWithMark"
];
"~h" = [
"setMark:"
"moveToEndOfParagraph:"
"swapWithMark"
];
"^x" = {
"u" = "undo:";
"k" = "performClose:";
"^f" = "openDocument:";
"^x" = "swapWithMark:";
"^m" = "selectToMark:";
"^s" = "saveDocument:";
"^w" = "saveDocumentAs:";
};
};
home.activation.configureDarwinKeyboard = let
userKeyMapping = [
{
HIDKeyboardModifierMappingSrc = 30064771303; # remap right command to right control.
HIDKeyboardModifierMappingDst = 30064771300;
}
];
in
lib.hm.dag.entryAfter ["writeBoundary"] ''
$VERBOSE_ECHO "Configuring Darwin keyboard mappings."
$DRY_RUN_CMD /usr/bin/hidutil property --set '{"UserKeyMapping":${builtins.toJSON userKeyMapping}}' > /dev/null
'';
}

View file

@ -146,6 +146,8 @@
(editorconfig-mode 1)
(global-set-key (kbd "C-c C-y") 'format-all-buffer)
(add-to-list 'format-all-default-formatters '("Nix" alejandra))
(setq-default format-all-formatters format-all-default-formatters)
(autoload 'gnuplot-mode "gnuplot" "Gnuplot major mode" t)
@ -325,8 +327,6 @@
(add-to-list 'auto-mode-alist '("\\.nix$" . poly-nix-mode))
(add-to-list 'format-all-default-formatters '("Nix" alejandra))
(define-key nix-mode-map (kbd "C-c C-u") 'nix-update-fetch)
(setq org-babel-octave-shell-command "octave -q")

View file

@ -15,8 +15,6 @@
'';
environment.loginShell = "${pkgs.zsh}/bin/zsh -l";
environment.systemPackages = with pkgs; [
];
programs.zsh.loginShellInit = ''
reexec() {
@ -34,65 +32,6 @@
services.nix-daemon.enable = true;
system = {
defaults = {
loginwindow = {
SHOWFULLNAME = false;
GuestEnabled = false;
DisableConsoleAccess = true;
};
LaunchServices.LSQuarantine = false;
dock = {
autohide = true;
launchanim = false;
minimize-to-application = true;
mru-spaces = false;
orientation = "bottom";
static-only = true;
tilesize = 35;
};
NSGlobalDomain = {
"com.apple.sound.beep.feedback" = 1;
AppleICUForce24HourTime = true;
AppleInterfaceStyle = "Dark";
AppleMeasurementUnits = "Centimeters";
AppleMetricUnits = 1;
AppleShowAllExtensions = true;
AppleShowScrollBars = "WhenScrolling";
AppleTemperatureUnit = "Celsius";
NSAutomaticCapitalizationEnabled = false;
NSAutomaticDashSubstitutionEnabled = false;
NSAutomaticPeriodSubstitutionEnabled = false;
NSAutomaticQuoteSubstitutionEnabled = false;
NSAutomaticSpellingCorrectionEnabled = false;
NSAutomaticWindowAnimationsEnabled = false;
NSDocumentSaveNewDocumentsToCloud = false;
NSNavPanelExpandedStateForSaveMode = true;
NSNavPanelExpandedStateForSaveMode2 = true;
NSTableViewDefaultSizeMode = 1;
NSTextShowsControlCharacters = true;
NSWindowResizeTime = 0.0;
};
trackpad = {
FirstClickThreshold = 0;
SecondClickThreshold = 2;
Clicking = true;
};
};
keyboard = {
enableKeyMapping = true;
remapCapsLockToEscape = true;
# see https://developer.apple.com/library/content/technotes/tn2450/_index.html for more info
userKeyMapping = [
{
HIDKeyboardModifierMappingSrc = 30064771303; # remap right command to right control.
HIDKeyboardModifierMappingDst = 30064771300;
}
];
};
};
users.users.willem = {
home = "/Users/willem";
isHidden = false;