aboutsummaryrefslogtreecommitdiff
path: root/nix/machines/darwin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--nix/machines/darwin-shared.nix111
-rw-r--r--nix/machines/darwin/aarch64-darwin/hq-kwny2vh41p.nix96
-rw-r--r--nix/machines/darwin/aarch64-darwin/mba-m2.nix98
3 files changed, 194 insertions, 111 deletions
diff --git a/nix/machines/darwin-shared.nix b/nix/machines/darwin-shared.nix
deleted file mode 100644
index 978b43a..0000000
--- a/nix/machines/darwin-shared.nix
+++ /dev/null
@@ -1,111 +0,0 @@
-{ pkgs, ... }:
-{
- 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 = "fcuny";
-
- system.defaults = {
- dock = {
- autohide = true;
- dashboard-in-overlay = false;
- launchanim = false; # Don't animate opening applications.
- mru-spaces = false; # don’t rearrange spaces based on the most recent use
- orientation = "left";
- show-recents = false;
- showhidden = false;
- tilesize = 60; # Default is 64.
- wvous-br-corner = 1; # Disable Notes hot corner.
- };
- finder.AppleShowAllExtensions = true;
-
- CustomUserPreferences = {
- "com.apple.desktopservices" = {
- # Avoid creating .DS_Store files on network or USB volumes
- DSDontWriteNetworkStores = true;
- DSDontWriteUSBStores = true;
- };
- };
-
- # Requires the directory to already exist.
- # See system.activationScripts.postUserActivation
- screencapture.location = "~/Documents/screenshots";
- SoftwareUpdate.AutomaticallyInstallMacOSUpdates = true;
- };
-
- # TODO: - The `system.activationScripts.postUserActivation` option has
- # been removed, as all activation now takes place as `root`. Please
- # restructure your custom activation scripts appropriately,
- # potentially using `sudo` if you need to run commands as a user.
- # system.activationScripts.postUserActivation.text = ''
- # mkdir -p ~/Documents/screenshots
- # '';
-
- fonts.packages = with pkgs; [
- source-code-pro
- ];
-
- system.keyboard = {
- enableKeyMapping = true;
- remapCapsLockToControl = true;
- };
-
- # Touch ID for sudo auth
- security.pam.services.sudo_local.touchIdAuth = true;
-
- 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
- '';
-
- ## this sets the PATH for GUI apps
- ## needs a restart
- launchd.user.agents = {
- user-paths = {
- command = "/bin/launchctl config user path '/opt/homebrew/bin:/Users/fcuny/.nix-profile/bin:/etc/profiles/per-user/fcuny/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin'";
- serviceConfig.RunAtLoad = true;
- };
- };
-
- programs.ssh.knownHosts = {
- "github.com".publicKey =
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl";
- };
-}
diff --git a/nix/machines/darwin/aarch64-darwin/hq-kwny2vh41p.nix b/nix/machines/darwin/aarch64-darwin/hq-kwny2vh41p.nix
new file mode 100644
index 0000000..c44ccaf
--- /dev/null
+++ b/nix/machines/darwin/aarch64-darwin/hq-kwny2vh41p.nix
@@ -0,0 +1,96 @@
+{
+ 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; [ grpcurl ];
+ imports = [
+ ../../../users/profiles/mac.nix
+ ../../../users/profiles/work.nix
+ ];
+ inherit (adminUser) userinfo;
+ programs.git.userEmail = "fcuny@roblox.com";
+ };
+}
diff --git a/nix/machines/darwin/aarch64-darwin/mba-m2.nix b/nix/machines/darwin/aarch64-darwin/mba-m2.nix
new file mode 100644
index 0000000..59fd21b
--- /dev/null
+++ b/nix/machines/darwin/aarch64-darwin/mba-m2.nix
@@ -0,0 +1,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;
+ };
+}