t
This commit is contained in:
@@ -45,9 +45,9 @@
|
||||
nixpkgs.hostPlatform = "aarch64-darwin"; # or "x86_64-darwin"
|
||||
|
||||
# TODO: Configure your system-wide user settings (groups, etc)
|
||||
users.users.your-username = {
|
||||
name = "your-username";
|
||||
home = "/Users/your-username";
|
||||
users.users.df = {
|
||||
name = "df";
|
||||
home = "/Users/df";
|
||||
};
|
||||
|
||||
# System-wide packages
|
||||
|
||||
Generated
+12
-11
@@ -7,15 +7,16 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1763136804,
|
||||
"narHash": "sha256-6p2ljK42s0S8zS0UU59EsEqupz0GVCaBYRylpUadeBM=",
|
||||
"lastModified": 1762912391,
|
||||
"narHash": "sha256-4hpBE7bGd24SfD28rzMdUGXsLsNEYxCCrTipFdoqoNM=",
|
||||
"owner": "LnL7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "973db96394513fd90270ea5a1211a82a4a0ba47f",
|
||||
"rev": "d76299b2cd01837c4c271a7b5186e3d5d8ebd126",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "LnL7",
|
||||
"ref": "nix-darwin-25.05",
|
||||
"repo": "nix-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -27,32 +28,32 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1726989464,
|
||||
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
|
||||
"lastModified": 1758463745,
|
||||
"narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
|
||||
"rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-24.05",
|
||||
"ref": "release-25.05",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1735563628,
|
||||
"narHash": "sha256-OnSAY7XDSx7CtDoqNh8jwVwh4xNL/2HaJxGjryLWzX8=",
|
||||
"lastModified": 1763049705,
|
||||
"narHash": "sha256-A5LS0AJZ1yDPTa2fHxufZN++n8MCmtgrJDtxFxrH4S8=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b134951a4c9f3c995fd7be05f3243f8ecd65d798",
|
||||
"rev": "3acb677ea67d4c6218f33de0db0955f116b7588c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-24.05",
|
||||
"ref": "nixos-25.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
|
||||
inputs = {
|
||||
# Nixpkgs
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
|
||||
# You can access packages and modules from different nixpkgs revs
|
||||
# at the same time. Here's an working example:
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
|
||||
|
||||
# Home manager
|
||||
home-manager.url = "github:nix-community/home-manager/release-24.05";
|
||||
home-manager.url = "github:nix-community/home-manager/release-25.05";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
# nix-darwin for macOS
|
||||
darwin.url = "github:LnL7/nix-darwin";
|
||||
darwin.url = "github:LnL7/nix-darwin/nix-darwin-25.05";
|
||||
darwin.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
./modules/kitty.nix
|
||||
./modules/neovim.nix
|
||||
./modules/tmux.nix
|
||||
./modules/skhd.nix
|
||||
./modules/yabai.nix
|
||||
|
||||
./modules/inbox.nix
|
||||
|
||||
|
||||
@@ -5,35 +5,204 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
# Modern replacements for standard tools
|
||||
ripgrep # Better grep
|
||||
fd # Better find
|
||||
sd # Better sed
|
||||
du-dust # Better du
|
||||
duf # Better df
|
||||
procs # Better ps
|
||||
bottom # Better top/htop
|
||||
|
||||
# System monitoring
|
||||
}:
|
||||
with pkgs; let
|
||||
wrapBin = p: a: b:
|
||||
pkgs.writeShellScriptBin b ''
|
||||
#!/usr/bin/env bash
|
||||
exec ${p}/bin/${a} $@
|
||||
'';
|
||||
pythonPackages = pkgs.python311.withPackages (p:
|
||||
with p; [
|
||||
python-lsp-server
|
||||
pyls-flake8
|
||||
pyls-isort
|
||||
pyls-spyder
|
||||
# pylsp-mypy
|
||||
pylsqpack
|
||||
black
|
||||
pipenv
|
||||
# nosetests
|
||||
pytest
|
||||
|
||||
yt-dlp
|
||||
opencv4
|
||||
|
||||
west
|
||||
pyelftools
|
||||
]);
|
||||
in {
|
||||
imports = [
|
||||
./modules/yabai/yabai.nix
|
||||
./modules/skhd/skhd.nix
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
maven363 = prev.maven.overrideAttrs (old: rec {
|
||||
pname = "apache-maven";
|
||||
version = "3.6.3";
|
||||
src = prev.pkgs.fetchurl {
|
||||
url = "mirror://apache/maven/maven-3/${version}/binaries/${pname}-${version}-bin.tar.gz";
|
||||
sha256 = "sha256-Jq2R11GzqaUwh676dD9OFqF3QdORWyGc90ESv4ekOMU=";
|
||||
};
|
||||
});
|
||||
})
|
||||
];
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"hadoop-3.3.1"
|
||||
"libressl-3.4.3"
|
||||
];
|
||||
nix = {
|
||||
configureBuildUsers = true;
|
||||
settings = {
|
||||
substituters = [
|
||||
"https://cache.nixos.org/"
|
||||
"https://cache.iog.io"
|
||||
"https://haskell-language-server.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
];
|
||||
trusted-users = ["@admin"];
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
|
||||
"haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
|
||||
experimental-features = ["ca-derivations" "nix-command" "flakes"];
|
||||
|
||||
keep-outputs = true;
|
||||
keep-derivations = true;
|
||||
|
||||
auto-optimise-store = true;
|
||||
max-jobs = 32;
|
||||
cores = 0;
|
||||
http-connections = 64;
|
||||
};
|
||||
package = nixUnstable;
|
||||
};
|
||||
|
||||
nix.extraOptions =
|
||||
""
|
||||
+ lib.optionalString (pkgs.system == "aarch64-darwin") ''
|
||||
extra-platforms = x86_64-darwin aarch64-darwin
|
||||
'';
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
gitAndTools.gitFull
|
||||
neovim
|
||||
vim
|
||||
ripgrep
|
||||
openvpn
|
||||
aria2
|
||||
ranger
|
||||
ncdu
|
||||
ffmpeg
|
||||
|
||||
cachix
|
||||
|
||||
# hyper-haskell
|
||||
cabal-install
|
||||
ghc
|
||||
#(haskell-language-server.override {supportedGhcVersions = ["943"];})
|
||||
|
||||
(aspellWithDicts (ds: with ds; [en en-computers en-science]))
|
||||
|
||||
rdesktop
|
||||
entr
|
||||
|
||||
fd
|
||||
fzf
|
||||
|
||||
texlive.combined.scheme-full
|
||||
imagemagick
|
||||
|
||||
alejandra
|
||||
(wrapBin alejandra "alejandra --quiet" "nixfmt")
|
||||
# nixfmt
|
||||
# nixpkgs-fmt
|
||||
pythonPackages
|
||||
# commandNotFound
|
||||
shellcheck
|
||||
shfmt
|
||||
|
||||
graphviz
|
||||
|
||||
htop
|
||||
|
||||
# File utilities
|
||||
tree
|
||||
|
||||
# Network tools
|
||||
|
||||
exa
|
||||
|
||||
openconnect
|
||||
yq
|
||||
bat
|
||||
delta
|
||||
|
||||
gnutar
|
||||
netcat-gnu
|
||||
jetbrains.idea-community
|
||||
|
||||
pywal
|
||||
|
||||
kcat
|
||||
leetcode-cli
|
||||
|
||||
nodejs
|
||||
redis
|
||||
# hadoop
|
||||
|
||||
direnv
|
||||
nix-direnv
|
||||
|
||||
pgformatter
|
||||
pgcli
|
||||
|
||||
sbt
|
||||
scala_2_12
|
||||
scalafix
|
||||
scalafmt
|
||||
coursier
|
||||
metals
|
||||
|
||||
protobuf
|
||||
mycli
|
||||
|
||||
# apktool no darwin
|
||||
|
||||
docker
|
||||
lima
|
||||
llvmPackages_14.clangUseLLVM
|
||||
|
||||
headscale
|
||||
kitty
|
||||
alacritty
|
||||
# add packages
|
||||
|
||||
w3m
|
||||
emacs
|
||||
parinfer-rust
|
||||
|
||||
sshuttle
|
||||
maven363
|
||||
|
||||
openssh
|
||||
|
||||
(wrapBin openssh "ssh" "fuckyou")
|
||||
gnupg
|
||||
gzip
|
||||
|
||||
esptool
|
||||
|
||||
cmake
|
||||
wget
|
||||
curl
|
||||
|
||||
# Text processing
|
||||
jq # JSON processor
|
||||
yq-go # YAML processor
|
||||
|
||||
# Optional file managers (commented out by default)
|
||||
# ranger
|
||||
# nnn
|
||||
# lf
|
||||
patchelf
|
||||
ninja
|
||||
|
||||
wireguard-tools
|
||||
wireguard-go
|
||||
|
||||
dfu-programmer
|
||||
dua
|
||||
# progs
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
# Simple Hotkey Daemon configuration
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
services.skhd = {
|
||||
enable = true;
|
||||
package = pkgs.skhd;
|
||||
skhdConfig = ''
|
||||
## Navigation (lalt - ...)
|
||||
# Space Navigation (four spaces per display): lalt - {1, 2, 3, 4}
|
||||
lalt - 1 : yabai -m space --focus 1
|
||||
lalt - 2 : yabai -m space --focus 2
|
||||
lalt - 3 : yabai -m space --focus 3
|
||||
lalt - 4 : yabai -m space --focus 4
|
||||
lalt - 5 : yabai -m space --focus 5
|
||||
lalt - 6 : yabai -m space --focus 6
|
||||
lalt - 7 : yabai -m space --focus 7
|
||||
lalt - 8 : yabai -m space --focus 8
|
||||
lalt - 9 : yabai -m space --focus 9
|
||||
lalt - 0 : yabai -m space --focus 0
|
||||
|
||||
# Window Navigation (through display borders): lalt - {h, j, k, l}
|
||||
lalt - h : yabai -m window --focus west || yabai -m display --focus west
|
||||
lalt - j : yabai -m window --focus south || yabai -m display --focus south
|
||||
lalt - k : yabai -m window --focus north || yabai -m display --focus north
|
||||
lalt - l : yabai -m window --focus east || yabai -m display --focus east
|
||||
|
||||
# Float / Unfloat window: lalt - space
|
||||
lalt - space : yabai -m window --toggle float; sketchybar --trigger window_focus
|
||||
|
||||
# Make window zoom to fullscreen: shift + lalt - f
|
||||
shift + lalt - f : yabai -m window --toggle zoom-fullscreen; sketchybar --trigger window_focus
|
||||
|
||||
# Make window zoom to parent node: lalt - f
|
||||
lalt - f : yabai -m window --toggle zoom-parent; sketchybar --trigger window_focus
|
||||
|
||||
## Window Movement (shift + lalt - ...)
|
||||
# Moving windows in spaces: shift + lalt - {h, j, k, l}
|
||||
shift + lalt - h : yabai -m window --warp west || $(yabai -m window --display west && sketchybar --trigger windows_on_spaces && yabai -m display --focus west && yabai -m window --warp last) || yabai -m window --move rel:-10:0
|
||||
shift + lalt - j : yabai -m window --warp south || $(yabai -m window --display south && sketchybar --trigger windows_on_spaces && yabai -m display --focus south) || yabai -m window --move rel:0:10
|
||||
shift + lalt - k : yabai -m window --warp north || $(yabai -m window --display north && sketchybar --trigger windows_on_spaces && yabai -m display --focus north) || yabai -m window --move rel:0:-10
|
||||
shift + lalt - l : yabai -m window --warp east || $(yabai -m window --display east && sketchybar --trigger windows_on_spaces && yabai -m display --focus east && yabai -m window --warp first) || yabai -m window --move rel:10:0
|
||||
|
||||
# Toggle split orientation of the selected windows node: shift + lalt - s
|
||||
shift + lalt - s : yabai -m window --toggle split
|
||||
|
||||
# Moving windows between spaces: shift + lalt - {1, 2, 3, 4, p, n } (Assumes 4 Spaces Max per Display)
|
||||
shift + lalt - 1 : DISPLAY="$(yabai -m query --displays --display | jq '.index')";\
|
||||
yabai -m window --space $((1+4*($DISPLAY - 1)));\
|
||||
sketchybar --trigger windows_on_spaces
|
||||
|
||||
shift + lalt - 2 : DISPLAY="$(yabai -m query --displays --display | jq '.index')";\
|
||||
yabai -m window --space $((2+4*($DISPLAY - 1)));\
|
||||
sketchybar --trigger windows_on_spaces
|
||||
|
||||
shift + lalt - 3 : DISPLAY="$(yabai -m query --displays --display | jq '.index')";\
|
||||
yabai -m window --space $((3+4*($DISPLAY - 1)));\
|
||||
sketchybar --trigger windows_on_spaces
|
||||
|
||||
shift + lalt - 4 : DISPLAY="$(yabai -m query --displays --display | jq '.index')";\
|
||||
yabai -m window --space $((4+4*($DISPLAY - 1)));\
|
||||
sketchybar --trigger windows_on_spaces
|
||||
|
||||
shift + lalt - p : yabai -m window --space prev; yabai -m space --focus prev; sketchybar --trigger windows_on_spaces
|
||||
shift + lalt - n : yabai -m window --space next; yabai -m space --focus next; sketchybar --trigger windows_on_spaces
|
||||
|
||||
# Mirror Space on X and Y Axis: shift + lalt - {x, y}
|
||||
shift + lalt - x : yabai -m space --mirror x-axis
|
||||
shift + lalt - y : yabai -m space --mirror y-axis
|
||||
|
||||
## Stacks (shift + ctrl - ...)
|
||||
# Add the active window to the window or stack to the {direction}: shift + ctrl - {h, j, k, l}
|
||||
shift + ctrl - h : yabai -m window west --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus
|
||||
shift + ctrl - j : yabai -m window south --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus
|
||||
shift + ctrl - k : yabai -m window north --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus
|
||||
shift + ctrl - l : yabai -m window east --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus
|
||||
|
||||
# Stack Navigation: shift + ctrl - {n, p}
|
||||
shift + ctrl - n : yabai -m window --focus stack.next
|
||||
shift + ctrl - p : yabai -m window --focus stack.prev
|
||||
|
||||
## Resize (ctrl + lalt - ...)
|
||||
# Resize windows: ctrl + lalt - {h, j, k, l}
|
||||
ctrl + lalt - h : yabai -m window --resize right:-100:0 || yabai -m window --resize left:-100:0
|
||||
ctrl + lalt - j : yabai -m window --resize bottom:0:100 || yabai -m window --resize top:0:100
|
||||
ctrl + lalt - k : yabai -m window --resize bottom:0:-100 || yabai -m window --resize top:0:-100
|
||||
ctrl + lalt - l : yabai -m window --resize right:100:0 || yabai -m window --resize left:100:0
|
||||
|
||||
# Equalize size of windows: ctrl + lalt - e
|
||||
ctrl + lalt - e : yabai -m space --balance
|
||||
|
||||
# Enable / Disable gaps in current workspace: ctrl + lalt - g
|
||||
ctrl + lalt - g : yabai -m space --toggle padding; yabai -m space --toggle gap
|
||||
|
||||
# Enable / Disable window borders in current workspace: ctrl + lalt - b
|
||||
ctrl + lalt - b : yabai -m config window_border off
|
||||
shift + ctrl + lalt - b : yabai -m config window_border on
|
||||
|
||||
## Misc
|
||||
# Open new Alacritty window
|
||||
cmd - return : kitty
|
||||
cmd - o : yabai -m window $(yabai -m query --windows | jq '.[] | select(.app==".kitty-wrapped") | .id') --space $(yabai -m query --spaces | jq '.[] | select(.has-focus==1) .id')
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
# Yabai window manager configuration (macOS only)
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# Only enable on macOS since yabai is macOS-specific
|
||||
services.yabai = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
enable = true;
|
||||
|
||||
# enableScriptingAddition = true;
|
||||
|
||||
package = pkgs.yabai;
|
||||
|
||||
config = {
|
||||
# layout
|
||||
layout = "bsp";
|
||||
auto_balance = "off";
|
||||
split_ratio = "0.50";
|
||||
window_placement = "second_child";
|
||||
|
||||
# Gaps
|
||||
window_gap = 18;
|
||||
top_padding = 18;
|
||||
bottom_padding = 52;
|
||||
left_padding = 18;
|
||||
right_padding = 18;
|
||||
|
||||
# shadows and borders
|
||||
window_shadow = "float";
|
||||
|
||||
# mouse
|
||||
mouse_follows_focus = "off";
|
||||
focus_follows_mouse = "off";
|
||||
mouse_modifier = "cmd";
|
||||
mouse_action1 = "move";
|
||||
mouse_action2 = "resize";
|
||||
mouse_drop_action = "swap";
|
||||
};
|
||||
|
||||
# # Unload the macOS WindowManager process
|
||||
# launchctl unload -F /System/Library/LaunchAgents/com.apple.WindowManager.plist > /dev/null 2>&1 &
|
||||
# # bar
|
||||
# yabai -m signal --add event=window_focused action="sketchybar --trigger window_focus"
|
||||
# yabai -m signal --add event=display_added action="sleep 1 && ${scripts}/create_spaces.sh"
|
||||
# yabai -m signal --add event=display_removed action="sleep 1 && ${scripts}/create_spaces.sh"
|
||||
# yabai -m signal --add event=window_created action="sketchybar --trigger windows_on_spaces"
|
||||
# yabai -m signal --add event=window_destroyed action="sketchybar --trigger windows_on_spaces"
|
||||
# ${scripts}/create_spaces.sh
|
||||
|
||||
extraConfig = ''
|
||||
# rules
|
||||
yabai -m rule --add app="^(Genshin Impact|LuLu|Vimac|Calculator|Software Update|Dictionary|VLC|System Preferences|zoom.us|Photo Booth|Archive Utility|Python|LibreOffice|App Store|Steam|Alfred|Activity Monitor)$" manage=off
|
||||
yabai -m rule --add label="Finder" app="^Finder$" title="(Co(py|nnect)|Move|Info|Pref)" manage=off
|
||||
yabai -m rule --add label="Safari" app="^Safari$" title="^(General|(Tab|Password|Website|Extension)s|AutoFill|Se(arch|curity)|Privacy|Advance)$" manage=off
|
||||
yabai -m rule --add label="About This Mac" app="System Information" title="About This Mac" manage=off
|
||||
yabai -m rule --add label="Select file to save to" app="^Inkscape$" title="Select file to save to" manage=off
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user