about summary refs log tree commit diff
path: root/nix/machines/darwin-shared.nix
blob: 344ff004eccd7e7260822d2fe9649f3ab20c6531 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{ 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"
    ];
  };
}