{ config, pkgs, ... }: { # 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"; # }; environment.systemPackages = [ pkgs.home-manager pkgs.neovim ]; # Use a custom configuration.nix location. #environment.darwinConfig = "$HOME/.dotfiles/hosts/laptop"; # Auto upgrade nix package and the daemon service. services.nix-daemon.enable = true; nix = { package = pkgs.nix; settings = { "extra-experimental-features" = ["nix-command" "flakes"]; }; }; nixpkgs.config.allowUnfree = true; # Create /etc/zshrc that loads the nix-darwin environment. programs = { gnupg.agent.enable = true; zsh.enable = true; # default shell on catalina }; 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 ''; }; # Used for backwards compatibility, please read the changelog before changing. # $ darwin-rebuild changelog system.stateVersion = 4; # Install fonts fonts.packages = [ pkgs.iosevka ]; services.tailscale.enable = true; # Use homebrew to install casks and Mac App Store apps 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; }; }; # set some OSX preferences that I always end up hunting down and changing. system.defaults = { # minimal dock dock = { autohide = false; show-process-indicators = true; show-recents = true; static-only = true; }; # a finder that tells me what I want to know and lets me work finder = { AppleShowAllExtensions = true; ShowPathbar = true; FXEnableExtensionChangeWarning = false; }; 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; }; }; }; }