feat: Split darwin into seperate folders as well

This commit is contained in:
uttarayan21
2025-02-07 13:20:47 +05:30
parent e0d55482f3
commit ec82997408
6 changed files with 22 additions and 5 deletions

View File

@@ -0,0 +1,79 @@
{
config,
pkgs,
...
}: {
imports = [./services];
# environment.systemPackages = with pkgs; [nix neovim];
nix = {
settings = {
experimental-features = "nix-command flakes auto-allocate-uids";
max-jobs = 8;
trusted-users = ["root" "fs0c131y"];
substituters = [
"https://nix-community.cachix.org"
"https://sh.darksailor.dev"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"mirai:bcVPoFGBZ0i7JAKMXIqLj2GY3CulLC4kP7rQyqes1RM="
];
};
extraOptions = ''
build-users-group = nixbld
extra-nix-path = nixpkgs=flake:nixpkgs
builders-use-substitutes = true
'';
package = pkgs.nixVersions.latest;
buildMachines = [
{
hostName = "sh.darksailor.dev";
sshUser = "remotebuilder";
system = "x86_64-linux";
protocol = "ssh-ng";
supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"];
}
];
distributedBuilds = true;
};
# security.pam.enableSudoTouchIdAuth = true;
# system.patches = [
# (pkgs.writeText "pam-reattach.patch"
# # diff
# ''
# new file mode 100644
# index 0000000..e4293c0
# --- /dev/null
# +++ b/etc/pam.d/sudo_local
# @@ -0,0 +1,3 @@
# +# sudo_local: local config file which survives system update and is included for sudo
# +# uncomment following line to enable Touch ID for sudo
# +auth optional ${pkgs.pam-reattach}/lib/pam/pam_reattach.so
# '')
# ];
# programs.bash.enable = true;
programs.zsh.enable = true;
programs.fish.enable = true;
services.nix-daemon.enable = true;
system.stateVersion = 4;
system.keyboard.enableKeyMapping = true;
system.keyboard.remapCapsLockToControl = true;
system.keyboard.swapLeftCommandAndLeftAlt = true;
system.keyboard.userKeyMapping = [
{
# Right Command to Option
HIDKeyboardModifierMappingSrc = 30064771303;
HIDKeyboardModifierMappingDst = 30064771302;
}
{
# Right Option to command
HIDKeyboardModifierMappingSrc = 30064771302;
HIDKeyboardModifierMappingDst = 30064771303;
}
];
}

View File

@@ -0,0 +1,7 @@
{...}: {
imports = [
./yabai.nix
./skhd.nix
./tailscale.nix
];
}

View File

@@ -0,0 +1,69 @@
{pkgs, ...}: {
services = {
skhd = {
enable = true;
skhdConfig = ''
# alt - return : ${pkgs.lib.getExe pkgs.kitty} --single-instance --directory ~
alt - return : ${pkgs.lib.getExe pkgs.wezterm}
shift + alt - return: pkill afplay
# close focused window
# alt - w : yabai -m window --close
alt - d : open -na "$(ls /Applications /System/Applications/ /System/Applications/Utilities/ | choose)"
# focus window
alt - h : yabai -m window --focus west
alt - j : yabai -m window --focus south
alt - k : yabai -m window --focus north
alt - l : yabai -m window --focus east
# alt - j : yabai -m window --focus prev
# alt - k : yabai -m window --focus next
# Float
shift + alt - f: yabai -m window --toggle float
alt - f: yabai -m window --toggle native-fullscreen
# swap window
# shift + alt - h : yabai -m window --swap west
# shift + alt - j : yabai -m window --swap south
# shift + alt - k : yabai -m window --swap north
# shift + alt - l : yabai -m window --swap east
# move window
shift + alt - h : yabai -m window --warp west
shift + alt - j : yabai -m window --warp south
shift + alt - k : yabai -m window --warp north
shift + alt - l : yabai -m window --warp east
# restart skhd
shift + alt - r : pkill skhd
# fast focus desktop
alt - 1 : yabai -m space --focus 1
alt - 2 : yabai -m space --focus 2
alt - 3 : yabai -m space --focus 3
alt - 4 : yabai -m space --focus 4
alt - 5 : yabai -m space --focus 5
alt - 6 : yabai -m space --focus 6
alt - 7 : yabai -m space --focus 7
alt - 8 : yabai -m space --focus 8
alt - 9 : yabai -m space --focus 9
alt - 0 : yabai -m space --focus 10
# Move window to desktop
shift + alt - 1 : yabai -m window --space 1
shift + alt - 2 : yabai -m window --space 2
shift + alt - 3 : yabai -m window --space 3
shift + alt - 4 : yabai -m window --space 4
shift + alt - 5 : yabai -m window --space 5
shift + alt - 6 : yabai -m window --space 6
shift + alt - 7 : yabai -m window --space 7
shift + alt - 8 : yabai -m window --space 8
shift + alt - 9 : yabai -m window --space 9
shift + alt - 0 : yabai -m window --space 10
'';
};
};
}

View File

@@ -0,0 +1,5 @@
{...}: {
services.tailscale = {
enable = true;
};
}

View File

@@ -0,0 +1,44 @@
{...}: {
services = {
yabai = {
enable = true;
enableScriptingAddition = true;
config = {
mouse_follows_focus = "on";
focus_follows_mouse = "on";
window_origin_display = "default";
window_placement = "second_child";
window_topmost = "off";
window_shadow = "on";
window_opacity = "off";
window_opacity_duration = "0.0";
active_window_opacity = "1.0";
normal_window_opacity = "0.90";
window_border = "off";
window_border_width = "6";
active_window_border_color = "0xff775759";
normal_window_border_color = "0xff555555";
insert_feedback_color = "0xffd75f5f";
split_ratio = "0.50";
auto_balance = "off";
mouse_modifier = "fn";
mouse_action1 = "move";
mouse_action2 = "resize";
mouse_drop_action = "swap";
layout = "bsp";
top_padding = "5";
bottom_padding = "5";
left_padding = "5";
right_padding = "5";
window_gap = "06";
};
extraConfig = ''
yabai -m rule --add app='System Preferences' manage=off
yabai -m rule --add app="choose" manage=off
yabai -m rule --add app="barrier" manage=off
yabai -m rule --add app="steam" manage=off
'';
};
};
}