WIP: Integration branch with darwin and deck support

- Added darwin and jovian inputs
- Added platform-specific package configurations
- Added darwinConfigurations and deck nixosConfiguration
- Copied darwin and deck specific files
- Fixed darwin version compatibility

Some configurations still need debugging
This commit is contained in:
Anish Lakhwara
2025-09-12 14:26:38 -07:00
parent 01c65f54af
commit 2ca6feff4d
43 changed files with 2114 additions and 164 deletions
+43
View File
@@ -0,0 +1,43 @@
{ ... }:
{
homebrew.enable = true;
homebrew.brews = [
"kind"
"kubectl"
"bazelisk"
"sourcegraph/src-cli/src-cli"
"gh"
# "postgresql@15"
# "redis"
];
homebrew.casks = [
# Development Tools
"homebrew/cask/docker"
# "syncthing"
# "insomnia"
# "tableplus"
# "ngrok"
"postico"
"wireshark"
"1password"
"orbstack"
# Communication Tools
# Already installed manually
# "loom"
# "slack"
# "zoom"
# "firefox"
# "1password-cli"
# Utility Tools
# "syncthing"
# Productivity Tools
"raycast"
# AI
# "diffusionbee"
];
}
+154
View File
@@ -0,0 +1,154 @@
{ self, pkgs, config, ... }:
{
imports = [
./sketchybar
./yabai
# ./casks
# ../../modules/darwin/home-manager.nix
# ../../modules/shared
# ../../modules/shared/cachix
];
environment.systemPackages = [
pkgs.go
pkgs.python3
pkgs.cargo
pkgs.k9s
pkgs.kubernetes-helm
pkgs.shellcheck
];
age.identityPaths = [ "/Users/anishlakhwara/.ssh/id_ed25519" ];
age.secrets.work-wg.file = "${self}/secrets/work-wg.age";
age.secrets.work-wg.owner = "anishlakhwara";
networking.wg-quick.interfaces = {
wg0 = {
address = [ "10.0.69.7/24" ];
listenPort = 60990; # to match firewall allowedUDPPorts (without this wg uses random port numbers)
privateKeyFile = config.age.secrets.work-wg.path;
dns = [ "10.0.69.4" ];
postDown = ''
sudo /usr/sbin/networksetup -setdnsservers Wi-Fi "Empty"
'';
peers = [
# For a client configuration, one peer entry for the server will suffice.
{
publicKey = "c1J4p63rD3IlszugMZiki7UBV3YmDdqa3DU4UejXzAI=";
allowedIPs = [ "10.0.69.0/24" ];
# Set this to the server IP and port.
endpoint = "sealight.xyz:60990"; # ToDo: route to endpoint not automatically configured https://wiki.archlinux.org/index.php/WireGuard#Loop_routing https://discourse.nixos.org/t/solved-minimal-firewall-setup-for-wireguard-client/7577
persistentKeepalive = 25;
}
];
};
};
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
nixpkgs.hostPlatform = "aarch64-darwin";
programs.zsh.enable = true;
# Setup user, packages, programs
nix = {
# package = pkgs.nixUnstable;
settings.trusted-users = [ "@admin" "anishlakhwara" ];
gc = {
user = "root";
automatic = true;
interval = { Weekday = 0; Hour = 2; Minute = 0; };
options = "--delete-older-than 30d";
};
# Turn this on to make command line easier
extraOptions = ''
experimental-features = nix-command flakes
'';
};
# Turn off NIX_PATH warnings now that we're using flakes
system.checks.verifyNixPath = false;
# Load configuration that is shared across systems
# environment.systemPackages = with pkgs; [
#
# ] ++ (import ../../modules/shared/packages.nix { inherit pkgs; });
# Enable fonts dir
# fonts.fontDir.enable = true;
fonts.packages = with pkgs; [
fira-code
fira-code-symbols
hermit
#hack
siji
font-awesome
proggyfonts
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Iosevka" ]; })
];
system = {
stateVersion = 4;
keyboard = {
enableKeyMapping = true;
};
defaults = {
LaunchServices = {
LSQuarantine = false;
};
NSGlobalDomain = {
AppleShowAllExtensions = true;
ApplePressAndHoldEnabled = false;
# 120, 90, 60, 30, 12, 6, 2
KeyRepeat = 2;
# 120, 94, 68, 35, 25, 15
InitialKeyRepeat = 15;
"com.apple.mouse.tapBehavior" = 1;
"com.apple.sound.beep.volume" = 0.0;
"com.apple.sound.beep.feedback" = 0;
};
loginwindow = {
# disable guest account
GuestEnabled = false;
# show name instead of username
SHOWFULLNAME = false;
};
dock = {
autohide = true;
autohide-delay = 0.0;
autohide-time-modifier = 1.0;
static-only = false;
showhidden = false;
show-recents = false;
launchanim = true;
mouse-over-hilite-stack = true;
orientation = "bottom";
tilesize = 48;
mru-spaces = false;
};
finder = {
_FXShowPosixPathInTitle = false;
};
trackpad = {
Clicking = false;
TrackpadThreeFingerDrag = true;
};
};
# keyboard = {
# enableKeyMapping = true;
# remapCapsLockToControl = true;
# };
};
}
+10
View File
@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
services.sketchybar = {
enable = true;
config = (builtins.readFile ./sketchybarrc);
extraPackages = [ pkgs.jq ];
};
}
+59
View File
@@ -0,0 +1,59 @@
#!/usr/bin/env bash
source "$HOME/.config/sketchybar/variables.sh" # Loads all defined colors
# General bar and defaults
# parts I didn't want
# y_offset=5 \
# margin=5 \
sketchybar --bar height=35 \
color="$BAR_COLOR" \
shadow="$SHADOW" \
position=top \
sticky=on \
padding_right=0 \
padding_left=3 \
corner_radius="$CORNER_RADIUS" \
blur_radius=20 \
notch_width=200 \
--default updates=when_shown \
icon.font="$FONT:Bold:13.5" \
icon.color="$ICON_COLOR" \
icon.padding_left="$PADDINGS" \
icon.padding_right="$PADDINGS" \
label.font="$FONT:Bold:13.0" \
label.color="$LABEL_COLOR" \
label.padding_left="$PADDINGS" \
label.padding_right="$PADDINGS" \
background.padding_right="$PADDINGS" \
background.padding_left="$PADDINGS" \
popup.background.border_width=1 \
popup.background.corner_radius=11 \
popup.background.border_color="$POPUP_BORDER_COLOR" \
popup.background.color="$POPUP_BACKGROUND_COLOR" \
popup.background.shadow.drawing="$SHADOW"
# Left
# source "$ITEM_DIR/apple.sh"
source "$ITEM_DIR/spaces.sh"
# Center (of notch)
# source "$ITEM_DIR/spotify.sh"
source "$ITEM_DIR/front_app.sh"
# Right
source "$ITEM_DIR/clock.sh"
source "$ITEM_DIR/calendar.sh"
source "$ITEM_DIR/battery.sh"
source "$ITEM_DIR/volume.sh"
source "$ITEM_DIR/cpu.sh"
source "$ITEM_DIR/vpn.sh"
#################### Finalizing Setup ####################
# sketchybar --hotload true
sketchybar --update
echo "sketchybar configuration loaded.."
+102
View File
@@ -0,0 +1,102 @@
{pkgs, ... }:
{
services.yabai = {
enable = true;
config = {
mouse_follows_focus = "off";
focus_follows_mouse = "off";
window_placement = "second_child";
window_topmost = "off";
window_opacity = "off";
window_opacity_duration = 0.0;
window_shadow = "on";
window_border = "off";
window_border_placement = "inset";
window_border_width = 4;
window_border_radius = -1.0;
active_window_border_topmost = "off";
active_window_border_color = "0xff775759";
normal_window_border_color = "0xff505050";
insert_window_border_color = "0xffd75f5f";
active_window_opacity = 1.0;
normal_window_opacity = 0.9;
split_ratio = 0.73;
auto_balance = "on";
mouse_modifier = "fn";
mouse_action1 = "move";
mouse_action2 = "resize";
layout = "bsp";
top_padding = 5;
bottom_padding = 5;
left_padding = 5;
right_padding = 5;
window_gap = 5;
};
extraConfig = ''
# Do not manage windows with certain titles eg. Copying files or moving to bin
yabai -m rule --add title="(Copy|Bin|About This Mac|Info)" manage=off
# Do not manage some apps which are not resizable
yabai -m rule --add app="^(Calculator|System Preferences|[sS]tats|[Jj]et[Bb]rains [Tt]ool[Bb]ox|kftray)$" manage=off
'';
};
system.activationScripts.yabai = {
enable = true;
text = ''
yabai --install-service && yabai --start-service
'';
};
services.skhd = {
enable = true;
skhdConfig = ''
# Open iTerm2
cmd - enter : kitty --single-instance -d ~
##################
# Window Motions #
##################
# Rotate
lalt - r : yabai -m space --rotate 90
# Mirror verticaly
lalt - x : yabai -m space --mirror y-axis
# Mirror horizontaly
lalt - y : yabai -m space --mirror x-axis
# yes, i know i swapped x and y, but I mainly use y-axis and y is further...
# Fullscreen
cmd - f : yabai -m window --toggle zoom-fullscreen
# Swap
lalt - q : yabai -m window --swap west
lalt - s : yabai -m window --swap south
lalt - z : yabai -m window --swap north
lalt - d : yabai -m window --swap east
# Warp
shift + lalt - q : yabai -m window --warp west
shift + lalt - s : yabai -m window --warp south
shift + lalt - z : yabai -m window --warp north
shift + lalt - d : yabai -m window --warp east
#########
# Focus #
#########
# Clockwise
# alt - tab : yabai -m window --focus "$(yabai -m query --windows --space | jq -re "[sort_by(.id, .frame) | .[] | select(.role == \"AXWindow\" and .subrole == \"AXStandardWindow\") | .id] | nth(index($(yabai -m query --windows --window | jq -re ".id")) - 1)")"
# Counter-clockwise
# shift - tab : yabai -m window --focus "$(yabai -m query --windows --space | jq -re "[sort_by(.id, .frame) | reverse | .[] | select(.role == \"AXWindow\" and .subrole == \"AXStandardWindow\") | .id] | nth(index($(yabai -m query --windows --window | jq -re ".id")) - 1)")"
##########
# Spaces #
##########
ctrl - left : yabai -m space --focus prev
ctrl - right : yabai -m space --focus next
ctrl + shift - right : yabai -m window --space next; yabai -m space --focus next
ctrl + shift - left : yabai -m window --space prev; yabai -m space --focus prev
cmd - 1 : yabai -m window --space 1; yabai -m space --focus 1
cmd - 2 : yabai -m window --space 2; yabai -m space --focus 2
cmd - 3 : yabai -m window --space 3; yabai -m space --focus 3
cmd - 4 : yabai -m window --space 4; yabai -m space --focus 4
cmd - 5 : yabai -m window --space 5; yabai -m space --focus 5
'';
};
}