[feat] Change paths around

This commit is contained in:
Uttarayan Mondal
2024-02-15 06:55:56 +05:30
parent 5ca9d2165c
commit 0aa2ea2a7a
8 changed files with 9 additions and 6 deletions

View File

@@ -0,0 +1,137 @@
{
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;
programs.bash.enable = true;
programs.zsh.enable = true;
programs.fish.enable = true;
nixpkgs.hostPlatform = device.system;
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;
}
];
}
# {
# description = "Example Darwin system flake";
# inputs = {
# nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
# # home-manager.url = "github:nix-community/home-manager/master";
# # home-manager.inputs.nixpkgs.follows = "nixpkgs";
# nix-darwin.url = "github:LnL7/nix-darwin";
# nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
# };
# outputs = inputs @ {
# self,
# nix-darwin,
# nixpkgs,
# }: let
# configuration = {pkgs, ...}: {
# # List packages installed in system profile. To search by name, run:
# # $ nix-env -qaP | grep wget
# environment.systemPackages = with pkgs; [
# neovim
# bat
# ripgrep
# fd
# fish
# nushellFull
# tmux
# wezterm
# # yabai
# nerdfonts
# ];
# # Auto upgrade nix package and the daemon service.
# services.nix-daemon.enable = true;
# # nix.package = pkgs.nix;
# # Necessary for using flakes on this system.
# nix = {
# settings = {
# experimental-features = "nix-command flakes repl-flake";
# max-jobs = 8;
# };
# extraOptions = ''
# build-users-group = nixbld
# extra-nix-path = nixpkgs=flake:nixpkgs
# '';
# # keep-outputs = true
# # keep-derivations = true
# };
# # Create /etc/zshrc that loads the nix-darwin environment.
# # programs.zsh.enable = true; # default shell on catalina
# # programs.fish.enable = true;
# # Set Git commit hash for darwin-version.
# system.configurationRevision = self.rev or self.dirtyRev or null;
# 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;
# };
# fonts.fonts = [(pkgs.nerdfonts.override {fonts = ["Hasklig" "Hack"];})];
# system.defaults.finder.AppleShowAllExtensions = true;
# system.defaults.dock.autohide = true;
# # Used for backwards compatibility, please read the changelog before changing.
# # $ darwin-rebuild changelog
# system.stateVersion = 4;
# # The platform the configuration will be used on.
# nixpkgs.hostPlatform = "aarch64-darwin";
# nix.package = pkgs.nix;
# };
# in {
# # Build darwin flake using:
# # $ darwin-rebuild build --flake .#simple
# darwinConfigurations.Uttarayans-MacBook-Pro = nix-darwin.lib.darwinSystem {
# # system = "aarch64-darwin";
# pkgs = import nixpkgs {system = "aarch64-darwin";};
# modules = [configuration];
# };
# # Expose the package set, including overlays, for convenience.
# # darwinPackages = self.darwinConfigurations.Uttarayans-MacBook-Pro.pkgs;
# };
# }

View File

@@ -0,0 +1,77 @@
{...}: {
services = {
skhd = {
enable = true;
skhdConfig = ''
# open terminal, blazingly fast compared to iTerm/Hyper
# alt - return : /Applications/kitty.app/Contents/MacOS/kitty --single-instance -d ~
alt - return : /Applications/WezTerm.app/Contents/MacOS/wezterm
shift + alt - return: pkill mpv
# alt + \ : pkill mpv
# open qutebrowser
# alt + shift - return : ~/Scripts/qtb.sh
# 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
'';
};
};
}

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