[feat] Restructure the repo

This commit is contained in:
uttarayan21
2024-03-13 23:04:54 +05:30
parent f5bcff9c73
commit 6961bb2733
125 changed files with 0 additions and 5411 deletions

57
darwin/configuration.nix Normal file
View File

@@ -0,0 +1,57 @@
{ pkgs, device, ... }: {
imports = [ ./yabai.nix ./skhd.nix ];
environment.systemPackages = with pkgs; [ nix neovim ];
nix = {
settings = {
experimental-features = "nix-command flakes repl-flake";
max-jobs = 8;
trusted-users = [ "root" "fs0c131y" ];
};
extraOptions = ''
build-users-group = nixbld
extra-nix-path = nixpkgs=flake:nixpkgs
'';
package = pkgs.nix;
};
# 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;
}
];
}

27
darwin/device.nix Normal file
View File

@@ -0,0 +1,27 @@
{ devices, inputs, overlays, home-manager, nix-darwin, ... }:
builtins.listToAttrs (builtins.map (device: {
name = device.name;
value = nix-darwin.lib.darwinSystem {
system = device.system;
modules = [
{
nixpkgs.overlays = overlays;
# nixpkgs.hostPlatform.config = device.system;
}
./configuration.nix
home-manager.darwinModules.home-manager
{
nixpkgs.config.allowUnfree = true;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs;
inherit device;
};
users.${device.user}.imports = [ ../common/home.nix ];
};
}
];
};
}) devices)

72
darwin/skhd.nix Normal file
View File

@@ -0,0 +1,72 @@
{ pkgs, ... }: {
services = {
skhd = {
enable = true;
skhdConfig = ''
# open terminal, blazingly fast compared to iTerm/Hyper
alt - return : ${pkgs.wezterm}/bin/wezterm-gui
shift + alt - return: pkill mpv
# open mpv
alt - m : open -na /Applications/mpv.app $(pbpaste)
# 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
'';
};
};
}

44
darwin/yabai.nix Normal file
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
'';
};
};
}