config/hosts/laptop/configuration.nix

106 lines
2.7 KiB
Nix
Raw Normal View History

2024-09-27 15:09:44 -07:00
{
2024-09-27 19:01:35 -07:00
config,
pkgs,
...
}: {
2024-09-30 10:06:51 -07:00
# nixpkgs.overlays = [
# (final: prev: {nh-darwin = nh_darwin.packages.${prev.system}.default;})
# ];
environment.shellAliases.nh = "nh_darwin";
# programs.nh = {
# enable = true;
# clean.enable = true;
# clean.extraArgs = "--keep-since 4d --keep 3";
# flake = "/Users/nmarks/.dotfiles";
# };
2024-09-27 19:01:35 -07:00
environment.systemPackages = [
pkgs.home-manager
pkgs.neovim
];
2024-09-27 15:09:44 -07:00
# Use a custom configuration.nix location.
2024-09-27 19:01:35 -07:00
#environment.darwinConfig = "$HOME/.dotfiles/hosts/laptop";
2024-09-27 15:09:44 -07:00
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nix = {
package = pkgs.nix;
settings = {
2024-09-27 19:01:35 -07:00
"extra-experimental-features" = ["nix-command" "flakes"];
2024-09-27 15:09:44 -07:00
};
};
2024-09-27 19:01:35 -07:00
nixpkgs.config.allowUnfree = true;
2024-09-27 15:09:44 -07:00
# Create /etc/zshrc that loads the nix-darwin environment.
programs = {
gnupg.agent.enable = true;
2024-09-27 19:01:35 -07:00
zsh.enable = true; # default shell on catalina
2024-09-27 15:09:44 -07:00
};
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
# Install fonts
2024-09-27 19:01:35 -07:00
fonts.packages = [
2024-09-27 15:09:44 -07:00
pkgs.iosevka
];
2024-09-30 10:06:51 -07:00
services.tailscale.enable = true;
2024-09-27 15:09:44 -07:00
# Use homebrew to install casks and Mac App Store apps
homebrew = {
enable = true;
casks = [
"1password"
"firefox"
"obsidian"
"raycast"
];
masApps = {
};
};
# set some OSX preferences that I always end up hunting down and changing.
system.defaults = {
# minimal dock
dock = {
2024-09-27 19:01:35 -07:00
autohide = false;
2024-09-30 15:57:29 -07:00
show-process-indicators = true;
2024-09-27 19:01:35 -07:00
show-recents = true;
2024-09-27 15:09:44 -07:00
static-only = true;
};
# a finder that tells me what I want to know and lets me work
finder = {
AppleShowAllExtensions = true;
ShowPathbar = true;
FXEnableExtensionChangeWarning = false;
};
2024-09-30 15:23:39 -07:00
CustomUserPreferences = {
launchd.user.agents.UserKeyMapping.serviceConfig = {
ProgramArguments = [
"/usr/bin/hidutil"
"property"
"--match"
"{"ProductID":0x0,"VendorID":0x0,"Product":"Apple Internal Keyboard / Trackpad"}"
"--set"
(
let
# https://developer.apple.com/library/archive/technotes/tn2450/_index.html
caps_lock = "0x700000039";
escape = "0x700000029";
in "{"UserKeyMapping":[{"HIDKeyboardModifierMappingDst":${escape},"HIDKeyboardModifierMappingSrc":${caps_lock}},{"HIDKeyboardModifierMappingDst":${caps_lock},"HIDKeyboardModifierMappingSrc":${escape}}]}"
)
];
RunAtLoad = true;
};
};
2024-09-27 15:09:44 -07:00
};
}