config/hosts/laptop/configuration.nix

135 lines
3.3 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;})
# ];
2024-10-11 14:37:12 -07:00
# environment.shellAliases.nh = "nh_darwin";
2024-09-30 10:06:51 -07:00
# 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
};
2024-10-05 14:47:09 -07:00
programs.zsh = {
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
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
2024-11-09 18:11:01 -08:00
homebrew = {
enable = true;
onActivation = {
autoUpdate = true;
cleanup = "uninstall";
upgrade = true;
};
# taps = [
# "legcord/legcord"
# ];
brews = [
"imagemagick"
];
casks = [
# "1password"
# "firefox"
# "obsidian"
# "raycast"
# "legcord"
"battle-net"
"stremio"
"alt-tab"
];
masApps = {
"wireguard" = 1451685025;
};
};
2024-09-27 15:09:44 -07:00
# 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
};
}