config/hosts/laptop/configuration.nix

140 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,
2025-04-18 15:55:34 -07:00
lib,
2024-09-27 19:01:35 -07:00
...
}: {
2025-04-18 15:55:34 -07:00
imports = [
2025-04-18 15:58:18 -07:00
../../modules/shared/vars.nix
2025-04-18 16:04:17 -07:00
../../modules/shared/nix.nix
2025-04-18 15:58:18 -07:00
../../modules/shared/extras.nix
2025-04-18 16:04:17 -07:00
../../modules/shared/modules.nix
../../modules/shared/home-manager.nix
2025-04-18 15:55:34 -07:00
./modules/icons.nix
];
2025-04-10 20:06:11 -07:00
environment.systemPackages = with pkgs; [
neovim
pinentry_mac
2024-09-27 19:01:35 -07:00
];
2024-09-27 15:09:44 -07:00
2025-04-18 15:55:34 -07:00
environment.customIcons = {
enable = true;
icons = [
{
path = "/Applications/Zen.app";
icon = "/Users/nmarks/.dotfiles/icons/Zen_icons/firefox.icns";
}
];
};
2025-03-31 13:37:38 -07:00
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
# 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 = ''
2024-11-23 21:04:36 -08:00
if [[ $(${pkgs.procps}/bin/ps -p $PPID -o comm) != "fish" && -z ''${ZSH_EXUCTION_STRING} ]]
2024-10-05 14:47:09 -07:00
then
2024-11-23 21:04:36 -08:00
[[ -o login ]] && LOGIN_OPTION='--login' || LOGIN_OPTION=""
2024-10-05 14:47:09 -07:00
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
2025-03-31 13:37:38 -07:00
system.stateVersion = 6;
2024-09-27 15:09:44 -07:00
# Install fonts
2024-09-27 19:01:35 -07:00
fonts.packages = [
2024-09-27 15:09:44 -07:00
pkgs.iosevka
2025-04-01 16:53:29 -07:00
pkgs.nerd-fonts.symbols-only
pkgs.nerd-fonts.iosevka
2024-09-27 15:09:44 -07:00
];
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;
2025-04-10 20:04:30 -07:00
cleanup = "none";
2024-11-09 18:11:01 -08:00
upgrade = true;
};
# taps = [
# "legcord/legcord"
# ];
brews = [
"imagemagick"
2025-04-10 20:04:30 -07:00
"opam"
2024-11-09 18:11:01 -08:00
];
casks = [
"battle-net"
"stremio"
"alt-tab"
2025-03-31 13:37:38 -07:00
"legcord"
2025-04-10 20:04:30 -07:00
"zulip"
"zen-browser"
2024-11-09 18:11:01 -08:00
];
masApps = {
"wireguard" = 1451685025;
};
};
2024-09-27 15:09:44 -07:00
2025-03-31 13:37:38 -07:00
security.pam.services.sudo_local = {
enable = true;
reattach = true;
touchIdAuth = true;
};
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
};
}