aboutsummaryrefslogblamecommitdiff
path: root/nix/machines/darwin-shared.nix
blob: b56670db1e3be6ab2f8fdf257e5a967e19802d73 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13

              

                                      
                







                               





















































                                                                                 



                            

















                                   
{ pkgs, ... }:
{
  nix = {
    package = pkgs.nixVersions.stable;
    settings = {
      trusted-users = [
        "@admin"
        "fcuny"
      ];
      experimental-features = [
        "nix-command"
        "flakes"
      ];
    };
  };

  system.defaults = {
    dock = {
      autohide = true;
      orientation = "left";
      showhidden = false;
      show-recents = false;
      mru-spaces = false; # don’t rearrange spaces based on the most recent use
    };
    finder.AppleShowAllExtensions = true;
    screencapture.location = "~/Documents/screenshots";
    SoftwareUpdate.AutomaticallyInstallMacOSUpdates = true;
  };

  fonts.packages = with pkgs; [
    emacs-all-the-icons-fonts
    google-fonts
    roboto
    source-code-pro
    source-serif-pro
    source-sans-pro
    go-font
  ];

  system.keyboard = {
    enableKeyMapping = true;
    remapCapsLockToControl = true;
  };

  # Touch ID for sudo auth
  security.pam.enableSudoTouchIdAuth = true;

  services.nix-daemon.enable = true;

  system.defaults.CustomUserPreferences = {
    "com.apple.desktopservices" = {
      # Avoid creating .DS_Store files on network or USB volumes
      DSDontWriteNetworkStores = true;
      DSDontWriteUSBStores = true;
    };
  };

  programs.fish.enable = true;
  programs.fish.shellInit = ''
    # Nix
    if test -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish'
      source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish'
    end
    # End Nix
  '';

  # Required for homebrew on aarch64
  environment.systemPath = [
    "/opt/homebrew/bin"
    "/opt/homebrew/sbin"
  ];

  homebrew = {
    enable = true;
    onActivation.autoUpdate = true;
    onActivation.upgrade = true;

    casks = [
      "1password-cli"
      "docker"
      "element"
      "emacs"
      "iterm2"
      "transmission"
      "vlc"
      "wireshark"
    ];
  };
}