aboutsummaryrefslogtreecommitdiff
path: root/nix/machines/darwin/aarch64-darwin/mba-m2.nix
blob: 59fd21b13a519ecb27ce4f7ab169080d9d6c7b6b (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{
  adminUser,
  pkgs,
  self,
  ...
}:
{
  imports = [
    "${self}/nix/profiles/home-manager.nix"
    "${self}/nix/profiles/darwin.nix"
  ];

  nix = {
    extraOptions = ''
      tarball-ttl = 900
    '';
    gc = {
      automatic = true;
      interval = {
        Weekday = 0;
        Hour = 0;
        Minute = 0;
      };
      options = "--delete-older-than 30d";
    };
    package = pkgs.nixVersions.stable;
    settings = {
      substituters = [
        "https://cache.nixos.org"
        "https://nix-community.cachix.org"
      ];
      trusted-public-keys = [
        "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
        "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
      ];
      trusted-users = [
        "@admin"
        "fcuny"
      ];
      experimental-features = [
        "nix-command"
        "flakes"
      ];
    };
  };

  system.primaryUser = adminUser.name;

  # https://github.com/nix-darwin/nix-darwin/issues/1339
  ids.gids.nixbld = 30000;

  networking.hostName = "mba-m2";

  fonts.packages = with pkgs; [
    source-code-pro
  ];

  # The user should already exist, but we need to set this up so Nix knows
  # what our home directory is (https://github.com/LnL7/nix-darwin/issues/423).
  users = {
    users.${adminUser.name} = {
      home = "/Users/${adminUser.name}";
      shell = pkgs.fish;
    };
  };

  environment.shells = [ pkgs.fish ];

  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
  '';

  programs.ssh.knownHosts = {
    "github.com".publicKey =
      "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl";
  };

  home-manager.users.${adminUser.name} = {
    home.stateVersion = "23.05";
    home.username = "${adminUser.name}";
    home.homeDirectory = "/Users/${adminUser.name}";
    home.packages = with pkgs; [
      element-desktop
      vlc-bin
      zoom-us
    ];
    imports = [
      ../../../users/profiles/mac.nix
      ../../../users/profiles/media.nix
    ];
    inherit (adminUser) userinfo;
  };
}