···11+#!/bin/bash
22+33+### You need to edit sudoers file to run wg-quick without password
44+55+# %admin ALL = (ALL) NOPASSWD: /nix/store/s2qw0sxax8pckbzmyw6wrarahmx65bq9-wireguard-tools-1.0.20210914/bin/wg-quick
66+77+WG_PIDFILE="/var/run/wireguard/wg0.name"
88+99+if [ -f $WG_PIDFILE ]; then
1010+ sketchybar -m --set vpn icon= \
1111+ label="$VPN" \
1212+ drawing=on \
1313+ click_script="~/.config/sketchybar/plugins/wg_off.sh"
1414+else
1515+ sketchybar -m --set vpn drawing=off click_script="~/.config/sketchybar/plugins/wg_on.sh"
1616+fi
+5
home/darwin/sketchybar/plugins/wg_off.sh
···11+### You need to edit sudoers file to run wg-quick without password
22+33+# %admin ALL = (ALL) NOPASSWD: /nix/store/s2qw0sxax8pckbzmyw6wrarahmx65bq9-wireguard-tools-1.0.20210914/bin/wg-quick
44+55+sudo wg-quick down wg0
+5
home/darwin/sketchybar/plugins/wg_on.sh
···11+### You need to edit sudoers file to run wg-quick without password
22+33+# %admin ALL = (ALL) NOPASSWD: /nix/store/s2qw0sxax8pckbzmyw6wrarahmx65bq9-wireguard-tools-1.0.20210914/bin/wg-quick
44+55+sudo wg-quick up wg0
+50
home/darwin/sketchybar/variables.sh
···11+#!/usr/bin/env sh
22+33+# Color Palette
44+# Tokyonight Night
55+BLACK=0xff24283b
66+WHITE=0xffa9b1d6
77+MAGENTA=0xffbb9af7
88+BLUE=0xff7aa2f7
99+CYAN=0xff7dcfff
1010+GREEN=0xff9ece6a
1111+YELLOW=0xffe0af68
1212+ORANGE=0xffff9e64
1313+RED=0xfff7768e
1414+BAR_COLOR=0xff1a1b26
1515+COMMENT=0xff565f89
1616+1717+# Tokyonight Day
1818+# BLACK=0xffe9e9ed
1919+# WHITE=0xff3760bf
2020+# MAGENTA=0xff9854f1
2121+# BLUE=0xff2e7de9
2222+# CYAN=0xff007197
2323+# GREEN=0xff587539
2424+# YELLOW=0xff8c6c3e
2525+# ORANGE=0xffb15c00
2626+# RED=0xfff52a65
2727+# BAR_COLOR=0xffe1e2e7
2828+2929+TRANSPARENT=0x00000000
3030+3131+# General bar colors
3232+ICON_COLOR=$WHITE # Color of all icons
3333+LABEL_COLOR=$WHITE # Color of all labels
3434+3535+ITEM_DIR="$HOME/.config/sketchybar/items"
3636+PLUGIN_DIR="$HOME/.config/sketchybar/plugins"
3737+3838+FONT="Iosevka Nerd Font"
3939+4040+PADDINGS=3
4141+4242+POPUP_BORDER_WIDTH=2
4343+POPUP_CORNER_RADIUS=11
4444+POPUP_BACKGROUND_COLOR=$BLACK
4545+POPUP_BORDER_COLOR=$COMMENT
4646+4747+CORNER_RADIUS=15
4848+BORDER_WIDTH=2
4949+5050+SHADOW=on
···11+{pkgs, ... }:
22+33+{
44+ services.yabai = {
55+ enable = true;
66+ config = {
77+ mouse_follows_focus = "off";
88+ focus_follows_mouse = "off";
99+ window_placement = "second_child";
1010+ window_topmost = "off";
1111+ window_opacity = "off";
1212+ window_opacity_duration = 0.0;
1313+ window_shadow = "on";
1414+ window_border = "off";
1515+ window_border_placement = "inset";
1616+ window_border_width = 4;
1717+ window_border_radius = -1.0;
1818+ active_window_border_topmost = "off";
1919+ active_window_border_color = "0xff775759";
2020+ normal_window_border_color = "0xff505050";
2121+ insert_window_border_color = "0xffd75f5f";
2222+ active_window_opacity = 1.0;
2323+ normal_window_opacity = 0.9;
2424+ split_ratio = 0.73;
2525+ auto_balance = "on";
2626+ mouse_modifier = "fn";
2727+ mouse_action1 = "move";
2828+ mouse_action2 = "resize";
2929+ layout = "bsp";
3030+ top_padding = 5;
3131+ bottom_padding = 5;
3232+ left_padding = 5;
3333+ right_padding = 5;
3434+ window_gap = 5;
3535+ };
3636+ extraConfig = ''
3737+ # Do not manage windows with certain titles eg. Copying files or moving to bin
3838+ yabai -m rule --add title="(Copy|Bin|About This Mac|Info)" manage=off
3939+ # Do not manage some apps which are not resizable
4040+ yabai -m rule --add app="^(Calculator|System Preferences|[sS]tats|[Jj]et[Bb]rains [Tt]ool[Bb]ox|kftray)$" manage=off
4141+ '';
4242+ };
4343+4444+ system.activationScripts.yabai = {
4545+ enable = true;
4646+ text = ''
4747+ yabai --install-service && yabai --start-service
4848+ '';
4949+ };
5050+5151+ services.skhd = {
5252+ enable = true;
5353+ skhdConfig = ''
5454+# Open iTerm2
5555+cmd - enter : kitty --single-instance -d ~
5656+5757+##################
5858+# Window Motions #
5959+##################
6060+# Rotate
6161+lalt - r : yabai -m space --rotate 90
6262+# Mirror verticaly
6363+lalt - x : yabai -m space --mirror y-axis
6464+# Mirror horizontaly
6565+lalt - y : yabai -m space --mirror x-axis
6666+# yes, i know i swapped x and y, but I mainly use y-axis and y is further...
6767+# Fullscreen
6868+cmd - f : yabai -m window --toggle zoom-fullscreen
6969+# Swap
7070+lalt - q : yabai -m window --swap west
7171+lalt - s : yabai -m window --swap south
7272+lalt - z : yabai -m window --swap north
7373+lalt - d : yabai -m window --swap east
7474+# Warp
7575+shift + lalt - q : yabai -m window --warp west
7676+shift + lalt - s : yabai -m window --warp south
7777+shift + lalt - z : yabai -m window --warp north
7878+shift + lalt - d : yabai -m window --warp east
7979+8080+#########
8181+# Focus #
8282+#########
8383+# Clockwise
8484+# 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)")"
8585+# Counter-clockwise
8686+# 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)")"
8787+8888+##########
8989+# Spaces #
9090+##########
9191+ctrl - left : yabai -m space --focus prev
9292+ctrl - right : yabai -m space --focus next
9393+ctrl + shift - right : yabai -m window --space next; yabai -m space --focus next
9494+ctrl + shift - left : yabai -m window --space prev; yabai -m space --focus prev
9595+cmd - 1 : yabai -m window --space 1; yabai -m space --focus 1
9696+cmd - 2 : yabai -m window --space 2; yabai -m space --focus 2
9797+cmd - 3 : yabai -m window --space 3; yabai -m space --focus 3
9898+cmd - 4 : yabai -m window --space 4; yabai -m space --focus 4
9999+cmd - 5 : yabai -m window --space 5; yabai -m space --focus 5
100100+ '';
101101+ };
102102+}
+120
hosts/deck/configuration.nix
···11+# Edit this configuration file to define what should be installed on
22+# your system. Help is available in the configuration.nix(5) man page
33+# and in the NixOS manual (accessible by running ‘nixos-help’).
44+55+{ config, pkgs, ... }:
66+77+{
88+ imports =
99+ [ # Include the results of the hardware scan.
1010+ ./hardware-configuration.nix
1111+ ];
1212+1313+ # Bootloader.
1414+ boot.loader.systemd-boot.enable = true;
1515+ boot.loader.efi.canTouchEfiVariables = true;
1616+1717+ networking.hostName = "deck"; # Define your hostname.
1818+ # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
1919+2020+ # Configure network proxy if necessary
2121+ # networking.proxy.default = "http://user:password@proxy:port/";
2222+ # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
2323+2424+ # Enable networking
2525+ networking.networkmanager.enable = true;
2626+2727+ # Set your time zone.
2828+ # time.timeZone = "America/Los_Angeles";
2929+3030+ # Select internationalisation properties.
3131+ i18n.defaultLocale = "en_US.UTF-8";
3232+3333+ # i18n.extraLocaleSettings = {
3434+ # LC_ADDRESS = "en_US.UTF-8";
3535+ # LC_IDENTIFICATION = "en_US.UTF-8";
3636+ # LC_MEASUREMENT = "en_US.UTF-8";
3737+ # LC_MONETARY = "en_US.UTF-8";
3838+ # LC_NAME = "en_US.UTF-8";
3939+ # LC_NUMERIC = "en_US.UTF-8";
4040+ # LC_PAPER = "en_US.UTF-8";
4141+ # LC_TELEPHONE = "en_US.UTF-8";
4242+ # LC_TIME = "en_US.UTF-8";
4343+ # };
4444+4545+ # Enable the X11 windowing system.
4646+ # services.xserver.enable = true;
4747+4848+ # Enable the GNOME Desktop Environment.
4949+ # services.xserver.displayManager.gdm.enable = true;
5050+ # services.xserver.desktopManager.gnome.enable = true;
5151+5252+ # Configure keymap in X11
5353+ # services.xserver.xkb = {
5454+ # layout = "us";
5555+ # variant = "";
5656+ # };
5757+5858+5959+ # use the example session manager (no others are packaged yet so this is enabled by default,
6060+ # no need to redefine it in your config for now)
6161+ #media-session.enable = true;
6262+6363+ # Enable touchpad support (enabled default in most desktopManager).
6464+ # services.xserver.libinput.enable = true;
6565+6666+ # Define a user account. Don't forget to set a password with ‘passwd’.
6767+ # users.users.anish = {
6868+ # isNormalUser = true;
6969+ # extraGroups = [ "networkmanager" "wheel" ];
7070+ # packages = with pkgs; [
7171+ # # thunderbird
7272+ # ];
7373+ # };
7474+7575+ # Enable automatic login for the user.
7676+ services.xserver.displayManager.autoLogin.enable = true;
7777+ services.xserver.displayManager.autoLogin.user = "anish";
7878+7979+ # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
8080+ systemd.services."getty@tty1".enable = false;
8181+ systemd.services."autovt@tty1".enable = false;
8282+8383+ # Install firefox.
8484+ # programs.firefox.enable = true;
8585+8686+ # List packages installed in system profile. To search, run:
8787+ # $ nix search wget
8888+ environment.systemPackages = with pkgs; [
8989+ # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
9090+ # wget
9191+ ];
9292+9393+ # Some programs need SUID wrappers, can be configured further or are
9494+ # started in user sessions.
9595+ # programs.mtr.enable = true;
9696+ # programs.gnupg.agent = {
9797+ # enable = true;
9898+ # enableSSHSupport = true;
9999+ # };
100100+101101+ # List services that you want to enable:
102102+103103+ # Enable the OpenSSH daemon.
104104+ # services.openssh.enable = true;
105105+106106+ # Open ports in the firewall.
107107+ # networking.firewall.allowedTCPPorts = [ ... ];
108108+ # networking.firewall.allowedUDPPorts = [ ... ];
109109+ # Or disable the firewall altogether.
110110+ # networking.firewall.enable = false;
111111+112112+ # This value determines the NixOS release from which the default
113113+ # settings for stateful data, like file locations and database versions
114114+ # on your system were taken. It‘s perfectly fine and recommended to leave
115115+ # this value at the release version of the first install of this system.
116116+ # Before changing this value read the documentation for this option
117117+ # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
118118+ system.stateVersion = "24.11"; # Did you read the comment?
119119+120120+}