rearrange and refactor multiple modules
This commit is contained in:
parent
622265bd6e
commit
be7cee9208
13 changed files with 233 additions and 456 deletions
|
|
@ -9,17 +9,13 @@
|
||||||
../../modules/ssh.nix
|
../../modules/ssh.nix
|
||||||
../../modules/git.nix
|
../../modules/git.nix
|
||||||
../../modules/lazygit.nix
|
../../modules/lazygit.nix
|
||||||
../../modules/rsync.nix
|
|
||||||
../../modules/btop.nix
|
../../modules/btop.nix
|
||||||
../../modules/firefox/home.nix
|
../../modules/firefox/home.nix
|
||||||
../../modules/ghostty.nix
|
../../modules/ghostty.nix
|
||||||
../../modules/syncthing.nix
|
../../modules/syncthing.nix
|
||||||
../../modules/claude-code.nix
|
../../modules/claude-code.nix
|
||||||
../../modules/tex.nix
|
|
||||||
../../modules/media/tool.nix
|
../../modules/media/tool.nix
|
||||||
../../modules/font/home.nix
|
../../modules/font/home.nix
|
||||||
../../modules/aerospace.nix
|
|
||||||
../../modules/peripheral/home.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
@ -154,26 +150,20 @@
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
texlive.combined.scheme-full
|
texlive.combined.scheme-full
|
||||||
|
|
||||||
# Network and file transfer
|
|
||||||
lftp
|
|
||||||
httpie
|
httpie
|
||||||
gnumake
|
gnumake
|
||||||
|
|
||||||
# Network diagnostic tools
|
|
||||||
bind # DNS utilities (dig, nslookup, mdig)
|
bind # DNS utilities (dig, nslookup, mdig)
|
||||||
inetutils # Network utilities (telnet)
|
inetutils # Network utilities (telnet)
|
||||||
netcat-gnu # Network connection utility
|
netcat-gnu # Network connection utility
|
||||||
curl # HTTP client
|
curl # HTTP client
|
||||||
wget # Web downloader
|
wget # Web downloader
|
||||||
bandwhich # Terminal bandwidth utilization tool
|
bandwhich # Terminal bandwidth utilization tool
|
||||||
|
|
||||||
# Command-line utilities
|
|
||||||
ncdu
|
ncdu
|
||||||
delta
|
delta
|
||||||
fastfetch
|
fastfetch
|
||||||
coreutils # GNU core utilities (base64, etc.)
|
coreutils # GNU core utilities (base64, etc.)
|
||||||
duti # Set default applications for file types (macOS)
|
duti # Set default applications for file types (macOS)
|
||||||
|
rsync
|
||||||
];
|
];
|
||||||
|
|
||||||
# Startup applications via launchd agents
|
# Startup applications via launchd agents
|
||||||
|
|
@ -317,4 +307,78 @@
|
||||||
run ${pkgs.duti}/bin/duti -s com.colliderli.iina .ogg all
|
run ${pkgs.duti}/bin/duti -s com.colliderli.iina .ogg all
|
||||||
run ${pkgs.duti}/bin/duti -s com.colliderli.iina .opus all
|
run ${pkgs.duti}/bin/duti -s com.colliderli.iina .opus all
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
home.file.".config/linearmouse/linearmouse.json".text = builtins.toJSON {
|
||||||
|
"$schema" = "https://app.linearmouse.org/schema/0.10.0";
|
||||||
|
schemes = [{
|
||||||
|
"if" = {
|
||||||
|
device.category = "mouse";
|
||||||
|
};
|
||||||
|
scrolling.reverse.vertical = true;
|
||||||
|
pointer = {
|
||||||
|
acceleration = 0;
|
||||||
|
speed = 0.6;
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file.".aerospace.toml".text = ''
|
||||||
|
# Make all new windows floating by default
|
||||||
|
[[on-window-detected]]
|
||||||
|
run = ['layout floating']
|
||||||
|
|
||||||
|
[mode.main.binding]
|
||||||
|
alt-enter = 'layout floating tiling'
|
||||||
|
alt-f = 'fullscreen'
|
||||||
|
alt-q = 'close'
|
||||||
|
|
||||||
|
# Window focus (vim-style)
|
||||||
|
alt-h = 'focus left'
|
||||||
|
alt-j = 'focus down'
|
||||||
|
alt-k = 'focus up'
|
||||||
|
alt-l = 'focus right'
|
||||||
|
|
||||||
|
# Move windows
|
||||||
|
alt-shift-h = 'move left'
|
||||||
|
alt-shift-j = 'move down'
|
||||||
|
alt-shift-k = 'move up'
|
||||||
|
alt-shift-l = 'move right'
|
||||||
|
|
||||||
|
# Resize
|
||||||
|
alt-minus = 'resize smart -50'
|
||||||
|
alt-equal = 'resize smart +50'
|
||||||
|
|
||||||
|
# Workspaces
|
||||||
|
alt-1 = 'workspace 1'
|
||||||
|
alt-2 = 'workspace 2'
|
||||||
|
alt-3 = 'workspace 3'
|
||||||
|
alt-4 = 'workspace 4'
|
||||||
|
alt-5 = 'workspace 5'
|
||||||
|
alt-6 = 'workspace 6'
|
||||||
|
alt-7 = 'workspace 7'
|
||||||
|
alt-8 = 'workspace 8'
|
||||||
|
alt-9 = 'workspace 9'
|
||||||
|
alt-0 = 'workspace 10'
|
||||||
|
|
||||||
|
# Focus monitor
|
||||||
|
alt-comma = 'focus-monitor prev'
|
||||||
|
alt-period = 'focus-monitor next'
|
||||||
|
|
||||||
|
# Move window to monitor
|
||||||
|
alt-shift-comma = 'move-node-to-monitor prev'
|
||||||
|
alt-shift-period = 'move-node-to-monitor next'
|
||||||
|
|
||||||
|
# Move window to workspace
|
||||||
|
alt-shift-1 = ['move-node-to-workspace 1', 'workspace 1']
|
||||||
|
alt-shift-2 = ['move-node-to-workspace 2', 'workspace 2']
|
||||||
|
alt-shift-3 = ['move-node-to-workspace 3', 'workspace 3']
|
||||||
|
alt-shift-4 = ['move-node-to-workspace 4', 'workspace 4']
|
||||||
|
alt-shift-5 = ['move-node-to-workspace 5', 'workspace 5']
|
||||||
|
alt-shift-6 = ['move-node-to-workspace 6', 'workspace 6']
|
||||||
|
alt-shift-7 = ['move-node-to-workspace 7', 'workspace 7']
|
||||||
|
alt-shift-8 = ['move-node-to-workspace 8', 'workspace 8']
|
||||||
|
alt-shift-9 = ['move-node-to-workspace 9', 'workspace 9']
|
||||||
|
alt-shift-0 = ['move-node-to-workspace 10', 'workspace 10']
|
||||||
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../modules/homebrew.nix
|
../../modules/homebrew.nix
|
||||||
../../modules/peripheral/system.nix
|
|
||||||
nix-homebrew.darwinModules.nix-homebrew
|
nix-homebrew.darwinModules.nix-homebrew
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -25,34 +24,31 @@
|
||||||
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
|
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
|
||||||
];
|
];
|
||||||
|
|
||||||
# System configuration
|
|
||||||
system.stateVersion = 6;
|
system.stateVersion = 6;
|
||||||
nixpkgs.hostPlatform = "aarch64-darwin";
|
nixpkgs.hostPlatform = "aarch64-darwin";
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
# Set primary user for system preferences
|
|
||||||
system.primaryUser = "yanlin";
|
system.primaryUser = "yanlin";
|
||||||
|
|
||||||
# Security configuration - passwordless sudo for yanlin
|
|
||||||
security.sudo.extraConfig = ''
|
security.sudo.extraConfig = ''
|
||||||
yanlin ALL=(ALL) NOPASSWD: ALL
|
yanlin ALL=(ALL) NOPASSWD: ALL
|
||||||
'';
|
'';
|
||||||
|
|
||||||
system.defaults = {
|
system.defaults = {
|
||||||
dock = {
|
dock = {
|
||||||
autohide = true; # Automatically hide and show the dock
|
autohide = true;
|
||||||
autohide-delay = 0.2; # Delay before showing the dock (in seconds)
|
autohide-delay = 0.2;
|
||||||
autohide-time-modifier = 0.5; # Animation duration for dock show/hide
|
autohide-time-modifier = 0.5;
|
||||||
orientation = "bottom"; # Dock position: "bottom", "left", or "right"
|
orientation = "bottom";
|
||||||
tilesize = 48; # Size of dock icons (16-128)
|
tilesize = 48;
|
||||||
magnification = false; # Enable magnification when hovering
|
magnification = false;
|
||||||
minimize-to-application = false; # Minimize windows to application icon
|
minimize-to-application = false;
|
||||||
show-recents = true; # Show recent applications in dock
|
show-recents = true;
|
||||||
show-process-indicators = true; # Show dots under running apps
|
show-process-indicators = true;
|
||||||
static-only = false; # Show only open applications
|
static-only = false;
|
||||||
mru-spaces = false; # Automatically rearrange spaces based on use
|
mru-spaces = false;
|
||||||
expose-animation-duration = 0.5; # Mission Control animation speed
|
expose-animation-duration = 0.5;
|
||||||
dashboard-in-overlay = false; # Show Dashboard as overlay
|
dashboard-in-overlay = false;
|
||||||
persistent-apps = [
|
persistent-apps = [
|
||||||
"/Applications/Ghostty.app"
|
"/Applications/Ghostty.app"
|
||||||
"/Applications/Firefox.app"
|
"/Applications/Firefox.app"
|
||||||
|
|
@ -61,73 +57,65 @@
|
||||||
];
|
];
|
||||||
persistent-others = [
|
persistent-others = [
|
||||||
"/Users/yanlin/Downloads"
|
"/Users/yanlin/Downloads"
|
||||||
]; # List of folders/files to keep in dock
|
];
|
||||||
|
|
||||||
# Hot Corners - Actions:
|
wvous-tl-corner = 1;
|
||||||
# 1 = Disabled, 2 = Mission Control, 3 = Application Windows,
|
wvous-tr-corner = 1;
|
||||||
# 4 = Desktop, 5 = Start Screen Saver, 6 = Disable Screen Saver,
|
wvous-bl-corner = 1;
|
||||||
# 7 = Dashboard, 10 = Put Display to Sleep, 11 = Launchpad,
|
wvous-br-corner = 1;
|
||||||
# 12 = Notification Center, 13 = Lock Screen, 14 = Quick Note
|
|
||||||
wvous-tl-corner = 1; # Top left corner action
|
|
||||||
wvous-tr-corner = 1; # Top right corner action
|
|
||||||
wvous-bl-corner = 1; # Bottom left corner action
|
|
||||||
wvous-br-corner = 1; # Bottom right corner action
|
|
||||||
};
|
};
|
||||||
|
|
||||||
finder = {
|
finder = {
|
||||||
AppleShowAllExtensions = true; # Show all file extensions
|
AppleShowAllExtensions = true;
|
||||||
AppleShowAllFiles = false; # Show hidden files
|
AppleShowAllFiles = false;
|
||||||
CreateDesktop = false; # Show icons on desktop
|
CreateDesktop = false;
|
||||||
FXEnableExtensionChangeWarning = false; # Warn when changing file extension
|
FXEnableExtensionChangeWarning = false;
|
||||||
FXPreferredViewStyle = "Nlsv"; # Default view: "icnv"=Icon, "Nlsv"=List, "clmv"=Column, "glyv"=Gallery
|
FXPreferredViewStyle = "Nlsv";
|
||||||
QuitMenuItem = false; # Allow quitting Finder with ⌘Q
|
QuitMenuItem = false;
|
||||||
ShowPathbar = true; # Show path bar at bottom
|
ShowPathbar = true;
|
||||||
ShowStatusBar = false; # Show status bar at bottom
|
ShowStatusBar = false;
|
||||||
_FXShowPosixPathInTitle = false; # Show full POSIX path in title
|
_FXShowPosixPathInTitle = false;
|
||||||
_FXSortFoldersFirst = true; # Sort folders before files
|
_FXSortFoldersFirst = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Global Domain Settings (NSGlobalDomain)
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
NSGlobalDomain = {
|
NSGlobalDomain = {
|
||||||
AppleInterfaceStyle = "Dark"; # Dark mode: "Dark" or remove for light
|
AppleInterfaceStyle = "Dark";
|
||||||
AppleInterfaceStyleSwitchesAutomatically = false; # Auto switch dark/light
|
AppleInterfaceStyleSwitchesAutomatically = false;
|
||||||
NSAutomaticWindowAnimationsEnabled = true; # Window animations
|
NSAutomaticWindowAnimationsEnabled = true;
|
||||||
NSDocumentSaveNewDocumentsToCloud = false; # Save to iCloud by default
|
NSDocumentSaveNewDocumentsToCloud = false;
|
||||||
NSNavPanelExpandedStateForSaveMode = true; # Expand save panel by default
|
NSNavPanelExpandedStateForSaveMode = true;
|
||||||
PMPrintingExpandedStateForPrint = true; # Expand print panel by default
|
PMPrintingExpandedStateForPrint = true;
|
||||||
NSTableViewDefaultSizeMode = 2; # Sidebar icon size: 1=small, 2=medium, 3=large
|
NSTableViewDefaultSizeMode = 2;
|
||||||
AppleShowScrollBars = "WhenScrolling"; # "WhenScrolling", "Automatic", or "Always"
|
AppleShowScrollBars = "WhenScrolling";
|
||||||
NSScrollAnimationEnabled = true; # Smooth scrolling
|
NSScrollAnimationEnabled = true;
|
||||||
NSWindowResizeTime = 0.2; # Window resize animation duration
|
NSWindowResizeTime = 0.2;
|
||||||
_HIHideMenuBar = false; # Auto-hide menu bar
|
_HIHideMenuBar = false;
|
||||||
|
|
||||||
NSAutomaticCapitalizationEnabled = false; # Disable automatic capitalization
|
NSAutomaticCapitalizationEnabled = false;
|
||||||
NSAutomaticDashSubstitutionEnabled = false; # Disable smart dashes
|
NSAutomaticDashSubstitutionEnabled = false;
|
||||||
NSAutomaticPeriodSubstitutionEnabled = false; # Disable automatic period with double-space
|
NSAutomaticPeriodSubstitutionEnabled = false;
|
||||||
NSAutomaticQuoteSubstitutionEnabled = false; # Disable smart quotes
|
NSAutomaticQuoteSubstitutionEnabled = false;
|
||||||
NSAutomaticSpellingCorrectionEnabled = false; # Disable auto-correction
|
NSAutomaticSpellingCorrectionEnabled = false;
|
||||||
NSAutomaticInlinePredictionEnabled = false; # Disable inline predictive text
|
NSAutomaticInlinePredictionEnabled = false;
|
||||||
"com.apple.keyboard.fnState" = false; # Use F1, F2, etc. as standard function keys
|
"com.apple.keyboard.fnState" = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
screencapture = {
|
screencapture = {
|
||||||
disable-shadow = false; # Disable shadow in screenshots
|
disable-shadow = false;
|
||||||
location = "~/Media/dcim-consume/"; # Default save location
|
location = "~/Media/dcim-consume/";
|
||||||
type = "png"; # Screenshot format: png, jpg, pdf, etc.
|
type = "png";
|
||||||
show-thumbnail = true; # Show thumbnail after taking screenshot
|
show-thumbnail = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
loginwindow = {
|
loginwindow = {
|
||||||
GuestEnabled = false; # Disable guest account
|
GuestEnabled = false;
|
||||||
ShutDownDisabled = false; # Allow shutdown from login window
|
ShutDownDisabled = false;
|
||||||
RestartDisabled = false; # Allow restart from login window
|
RestartDisabled = false;
|
||||||
SleepDisabled = false; # Allow sleep from login window
|
SleepDisabled = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
spaces = {
|
spaces = {
|
||||||
spans-displays = false; # Each display has separate spaces
|
spans-displays = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -138,4 +126,20 @@
|
||||||
|
|
||||||
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
launchd.user.agents.remap-keys = {
|
||||||
|
serviceConfig = {
|
||||||
|
ProgramArguments = [
|
||||||
|
"/usr/bin/hidutil"
|
||||||
|
"property"
|
||||||
|
"--set"
|
||||||
|
''{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x7000000E0},{"HIDKeyboardModifierMappingSrc":0x7000000E4,"HIDKeyboardModifierMappingDst":0x700000039}]}''
|
||||||
|
];
|
||||||
|
RunAtLoad = true;
|
||||||
|
KeepAlive = false;
|
||||||
|
Label = "org.nixos.remap-keys";
|
||||||
|
StandardErrorPath = "/tmp/remap-keys.err";
|
||||||
|
StandardOutPath = "/tmp/remap-keys.out";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
../../modules/ssh.nix
|
../../modules/ssh.nix
|
||||||
../../modules/git.nix
|
../../modules/git.nix
|
||||||
../../modules/lazygit.nix
|
../../modules/lazygit.nix
|
||||||
../../modules/rsync.nix
|
|
||||||
../../modules/btop.nix
|
../../modules/btop.nix
|
||||||
../../modules/font/home.nix
|
../../modules/font/home.nix
|
||||||
];
|
];
|
||||||
|
|
@ -38,18 +37,13 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# Network and file transfer
|
|
||||||
lftp
|
|
||||||
httpie
|
httpie
|
||||||
gnumake
|
gnumake
|
||||||
|
rsync
|
||||||
# Network diagnostic tools
|
|
||||||
bind # DNS utilities (dig, nslookup, mdig)
|
bind # DNS utilities (dig, nslookup, mdig)
|
||||||
iputils # Core network tools (ping, traceroute)
|
iputils # Core network tools (ping, traceroute)
|
||||||
inetutils # Network utilities (telnet)
|
inetutils # Network utilities (telnet)
|
||||||
netcat-gnu # Network connection utility
|
netcat-gnu # Network connection utility
|
||||||
|
|
||||||
# Command-line utilities
|
|
||||||
ncdu
|
ncdu
|
||||||
delta
|
delta
|
||||||
fastfetch
|
fastfetch
|
||||||
|
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.file.".aerospace.toml".text = ''
|
|
||||||
# Make all new windows floating by default
|
|
||||||
[[on-window-detected]]
|
|
||||||
run = ['layout floating']
|
|
||||||
|
|
||||||
[mode.main.binding]
|
|
||||||
alt-enter = 'layout floating tiling'
|
|
||||||
alt-f = 'fullscreen'
|
|
||||||
alt-q = 'close'
|
|
||||||
|
|
||||||
# Window focus (vim-style)
|
|
||||||
alt-h = 'focus left'
|
|
||||||
alt-j = 'focus down'
|
|
||||||
alt-k = 'focus up'
|
|
||||||
alt-l = 'focus right'
|
|
||||||
|
|
||||||
# Move windows
|
|
||||||
alt-shift-h = 'move left'
|
|
||||||
alt-shift-j = 'move down'
|
|
||||||
alt-shift-k = 'move up'
|
|
||||||
alt-shift-l = 'move right'
|
|
||||||
|
|
||||||
# Resize
|
|
||||||
alt-minus = 'resize smart -50'
|
|
||||||
alt-equal = 'resize smart +50'
|
|
||||||
|
|
||||||
# Workspaces
|
|
||||||
alt-1 = 'workspace 1'
|
|
||||||
alt-2 = 'workspace 2'
|
|
||||||
alt-3 = 'workspace 3'
|
|
||||||
alt-4 = 'workspace 4'
|
|
||||||
alt-5 = 'workspace 5'
|
|
||||||
alt-6 = 'workspace 6'
|
|
||||||
alt-7 = 'workspace 7'
|
|
||||||
alt-8 = 'workspace 8'
|
|
||||||
alt-9 = 'workspace 9'
|
|
||||||
alt-0 = 'workspace 10'
|
|
||||||
|
|
||||||
# Focus monitor
|
|
||||||
alt-comma = 'focus-monitor prev'
|
|
||||||
alt-period = 'focus-monitor next'
|
|
||||||
|
|
||||||
# Move window to monitor
|
|
||||||
alt-shift-comma = 'move-node-to-monitor prev'
|
|
||||||
alt-shift-period = 'move-node-to-monitor next'
|
|
||||||
|
|
||||||
# Move window to workspace
|
|
||||||
alt-shift-1 = ['move-node-to-workspace 1', 'workspace 1']
|
|
||||||
alt-shift-2 = ['move-node-to-workspace 2', 'workspace 2']
|
|
||||||
alt-shift-3 = ['move-node-to-workspace 3', 'workspace 3']
|
|
||||||
alt-shift-4 = ['move-node-to-workspace 4', 'workspace 4']
|
|
||||||
alt-shift-5 = ['move-node-to-workspace 5', 'workspace 5']
|
|
||||||
alt-shift-6 = ['move-node-to-workspace 6', 'workspace 6']
|
|
||||||
alt-shift-7 = ['move-node-to-workspace 7', 'workspace 7']
|
|
||||||
alt-shift-8 = ['move-node-to-workspace 8', 'workspace 8']
|
|
||||||
alt-shift-9 = ['move-node-to-workspace 9', 'workspace 9']
|
|
||||||
alt-shift-0 = ['move-node-to-workspace 10', 'workspace 10']
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
125
modules/btop.nix
125
modules/btop.nix
|
|
@ -3,80 +3,65 @@
|
||||||
{
|
{
|
||||||
programs.btop = {
|
programs.btop = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
# Theme and Visual Settings (Gruvbox Dark to match nvim/tmux)
|
|
||||||
color_theme = "gruvbox_dark";
|
color_theme = "gruvbox_dark";
|
||||||
theme_background = false; # Transparent background
|
theme_background = false;
|
||||||
truecolor = true; # 24-bit color support
|
truecolor = true;
|
||||||
rounded_corners = true; # Modern rounded appearance
|
rounded_corners = true;
|
||||||
graph_symbol = "braille"; # High-resolution graph symbols
|
graph_symbol = "braille";
|
||||||
|
|
||||||
# Vim-style Navigation
|
vim_keys = true;
|
||||||
vim_keys = true; # Enable h,j,k,l,g,G navigation
|
|
||||||
|
update_ms = 1000;
|
||||||
# Performance and Update Settings
|
background_update = true;
|
||||||
update_ms = 1000; # Faster updates (1 second)
|
|
||||||
background_update = true; # Continue updating when not focused
|
cpu_single_graph = false;
|
||||||
|
cpu_graph_upper = "total";
|
||||||
# CPU Display Settings
|
cpu_graph_lower = "total";
|
||||||
cpu_single_graph = false; # Show per-core graphs
|
cpu_invert_lower = true;
|
||||||
cpu_graph_upper = "total"; # Upper graph shows total usage
|
show_uptime = true;
|
||||||
cpu_graph_lower = "total"; # Lower graph shows total usage
|
show_cpu_freq = true;
|
||||||
cpu_invert_lower = true; # Invert lower graph for better visualization
|
check_temp = true;
|
||||||
show_uptime = true; # Display system uptime
|
show_coretemp = true;
|
||||||
show_cpu_freq = true; # Show CPU frequency
|
temp_scale = "celsius";
|
||||||
check_temp = true; # Monitor CPU temperature
|
cpu_sensor = "Auto";
|
||||||
show_coretemp = true; # Display core temperatures
|
|
||||||
temp_scale = "celsius"; # Use Celsius for temperature
|
proc_sorting = "cpu lazy";
|
||||||
cpu_sensor = "Auto"; # Auto-detect temperature sensors
|
proc_tree = false;
|
||||||
|
proc_colors = true;
|
||||||
# Process Display Settings
|
proc_gradient = true;
|
||||||
proc_sorting = "cpu lazy"; # Sort by CPU usage, lazy update
|
proc_per_core = false;
|
||||||
proc_tree = false; # Show process hierarchy
|
proc_mem_bytes = true;
|
||||||
proc_colors = true; # Colorize process list
|
show_init = false;
|
||||||
proc_gradient = true; # Use gradient colors for processes
|
|
||||||
proc_per_core = false; # Don't show per-core process usage
|
mem_graphs = true;
|
||||||
proc_mem_bytes = true; # Show memory in bytes
|
show_swap = true;
|
||||||
show_init = false; # Hide init processes
|
swap_disk = true;
|
||||||
|
|
||||||
# Memory Settings
|
show_disks = true;
|
||||||
mem_graphs = true; # Show memory graphs
|
use_fstab = false;
|
||||||
show_swap = true; # Display swap usage
|
disks_filter = "";
|
||||||
swap_disk = true; # Show swap as disk usage
|
|
||||||
|
net_download = 100;
|
||||||
# Disk Settings
|
net_upload = 100;
|
||||||
show_disks = true; # Display disk usage
|
net_auto = true;
|
||||||
use_fstab = false; # Don't use fstab for disk detection
|
net_sync = false;
|
||||||
disks_filter = ""; # No disk filtering
|
net_iface = "";
|
||||||
|
|
||||||
# Network Settings
|
show_battery = true;
|
||||||
net_download = 100; # Network download scale (Mbps)
|
|
||||||
net_upload = 100; # Network upload scale (Mbps)
|
show_gpu_info = "Auto";
|
||||||
net_auto = true; # Auto-scale network graphs
|
nvml_measure_pcie_speeds = false;
|
||||||
net_sync = false; # Don't sync download/upload scales
|
gpu_mirror_graph = true;
|
||||||
net_iface = ""; # Auto-detect network interface
|
|
||||||
|
|
||||||
# Battery Settings (MacBook Air)
|
|
||||||
show_battery = true; # Show battery status
|
|
||||||
|
|
||||||
# GPU Settings (system-specific)
|
|
||||||
show_gpu_info = "Auto"; # Auto-detect GPU (works on Linux with Intel/AMD/NVIDIA)
|
|
||||||
nvml_measure_pcie_speeds = false; # NVIDIA-specific, disabled for compatibility
|
|
||||||
gpu_mirror_graph = true; # Mirror GPU graph when available
|
|
||||||
|
|
||||||
# Layout Settings (platform-aware)
|
|
||||||
# Note: GPU box only shown on Linux where GPU monitoring is fully supported
|
|
||||||
# Darwin has limited GPU support (basic metrics only)
|
|
||||||
shown_boxes = "cpu mem net proc gpu";
|
shown_boxes = "cpu mem net proc gpu";
|
||||||
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty";
|
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty";
|
||||||
|
|
||||||
# Clock Display
|
draw_clock = "%X";
|
||||||
draw_clock = "%X"; # Display time in HH:MM:SS format
|
|
||||||
|
force_tty = false;
|
||||||
# Miscellaneous
|
custom_cpu_name = "";
|
||||||
force_tty = false; # Don't force TTY mode
|
|
||||||
custom_cpu_name = ""; # Use detected CPU name
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,75 +46,51 @@ in
|
||||||
programs.ghostty = {
|
programs.ghostty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = cfg.package;
|
package = cfg.package;
|
||||||
|
|
||||||
settings = mkMerge [
|
settings = mkMerge [
|
||||||
{
|
{
|
||||||
# Font settings with CJK fallback
|
|
||||||
font-family = [
|
font-family = [
|
||||||
"JetBrainsMono Nerd Font Mono" # Primary font for Latin + symbols
|
"JetBrainsMono Nerd Font Mono"
|
||||||
"Noto Sans CJK SC" # Simplified Chinese fallback
|
"Noto Sans CJK SC"
|
||||||
"Noto Sans CJK TC" # Traditional Chinese fallback
|
"Noto Sans CJK TC"
|
||||||
"Noto Sans CJK JP" # Japanese fallback
|
"Noto Sans CJK JP"
|
||||||
"Source Han Sans" # Alternative CJK fallback
|
"Source Han Sans"
|
||||||
];
|
];
|
||||||
font-family-bold = "JetBrainsMono NFM Bold";
|
font-family-bold = "JetBrainsMono NFM Bold";
|
||||||
font-family-italic = "JetBrainsMono NFM Italic";
|
font-family-italic = "JetBrainsMono NFM Italic";
|
||||||
font-family-bold-italic = "JetBrainsMono NFM Bold Italic";
|
font-family-bold-italic = "JetBrainsMono NFM Bold Italic";
|
||||||
font-size = cfg.fontSize;
|
font-size = cfg.fontSize;
|
||||||
|
|
||||||
# Gruvbox Dark Theme
|
|
||||||
background = "#14191f";
|
background = "#14191f";
|
||||||
cursor-style-blink = false;
|
cursor-style-blink = false;
|
||||||
|
|
||||||
# Window config
|
|
||||||
window-theme = "dark";
|
window-theme = "dark";
|
||||||
window-padding-balance = true;
|
window-padding-balance = true;
|
||||||
|
|
||||||
# Shell integration
|
|
||||||
shell-integration = "detect";
|
shell-integration = "detect";
|
||||||
shell-integration-features = "cursor,sudo,title";
|
shell-integration-features = "cursor,sudo,title";
|
||||||
|
|
||||||
# Terminal type - use widely-supported xterm-256color for SSH compatibility
|
|
||||||
term = "xterm-256color";
|
term = "xterm-256color";
|
||||||
|
|
||||||
# Mouse settings
|
|
||||||
mouse-hide-while-typing = true;
|
mouse-hide-while-typing = true;
|
||||||
mouse-shift-capture = false;
|
mouse-shift-capture = false;
|
||||||
|
|
||||||
# Performance and appearance
|
|
||||||
adjust-cell-height = "10%";
|
adjust-cell-height = "10%";
|
||||||
minimum-contrast = 1.0;
|
minimum-contrast = 1.0;
|
||||||
|
|
||||||
# Copy/paste
|
|
||||||
copy-on-select = false;
|
copy-on-select = false;
|
||||||
|
clipboard-read = "allow";
|
||||||
# OSC-52 clipboard integration (works with Neovim and tmux)
|
clipboard-write = "allow";
|
||||||
clipboard-read = "allow"; # Allow programs to read clipboard without prompting
|
|
||||||
clipboard-write = "allow"; # Allow programs to write to clipboard without prompting
|
|
||||||
|
|
||||||
# Scrollback
|
|
||||||
scrollback-limit = 10000;
|
scrollback-limit = 10000;
|
||||||
|
|
||||||
# Bell
|
|
||||||
desktop-notifications = false;
|
desktop-notifications = false;
|
||||||
|
|
||||||
# Quit behavior
|
|
||||||
confirm-close-surface = false;
|
confirm-close-surface = false;
|
||||||
|
|
||||||
macos-titlebar-style = "hidden";
|
macos-titlebar-style = "hidden";
|
||||||
macos-option-as-alt = "left";
|
macos-option-as-alt = "left";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Conditional window settings based on mode
|
|
||||||
(mkIf (cfg.windowMode == "windowed") {
|
(mkIf (cfg.windowMode == "windowed") {
|
||||||
window-width = cfg.windowWidth;
|
window-width = cfg.windowWidth;
|
||||||
window-height = cfg.windowHeight;
|
window-height = cfg.windowHeight;
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.windowMode == "maximized") {
|
(mkIf (cfg.windowMode == "maximized") {
|
||||||
maximize = true;
|
maximize = true;
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.windowMode == "fullscreen") {
|
(mkIf (cfg.windowMode == "fullscreen") {
|
||||||
fullscreen = true;
|
fullscreen = true;
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,19 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Enable git-credential-oauth for GitHub, GitLab, BitBucket
|
|
||||||
programs.git-credential-oauth = {
|
programs.git-credential-oauth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
ignores = [
|
ignores = [
|
||||||
# Claude Code
|
|
||||||
"**/.claude/settings.local.json"
|
"**/.claude/settings.local.json"
|
||||||
|
|
||||||
# macOS
|
|
||||||
".DS_Store"
|
".DS_Store"
|
||||||
|
|
||||||
# Editors
|
|
||||||
".vscode/"
|
|
||||||
".idea/"
|
|
||||||
|
|
||||||
# Development
|
|
||||||
"node_modules/"
|
|
||||||
".env"
|
".env"
|
||||||
".env.local"
|
"node_modules/"
|
||||||
".env.*.local"
|
".venv/"
|
||||||
];
|
];
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
|
@ -32,14 +22,10 @@
|
||||||
email = "github@yanlincs.com";
|
email = "github@yanlincs.com";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Platform-specific credential configuration
|
|
||||||
credential = {
|
credential = {
|
||||||
# OAuth platforms (handled by git-credential-oauth)
|
|
||||||
"https://github.com".helper = "oauth";
|
"https://github.com".helper = "oauth";
|
||||||
"https://gitlab.com".helper = "oauth";
|
"https://gitlab.com".helper = "oauth";
|
||||||
"https://bitbucket.org".helper = "oauth";
|
"https://bitbucket.org".helper = "oauth";
|
||||||
|
|
||||||
# Token-based platforms
|
|
||||||
"https://git.overleaf.com".helper = "store";
|
"https://git.overleaf.com".helper = "store";
|
||||||
"https://git.overleaf.com".username = "git";
|
"https://git.overleaf.com".username = "git";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,15 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Homebrew configuration for package management
|
|
||||||
homebrew = {
|
homebrew = {
|
||||||
enable = true;
|
enable = true;
|
||||||
onActivation = {
|
onActivation = {
|
||||||
autoUpdate = true;
|
autoUpdate = true;
|
||||||
cleanup = "zap"; # Removes unlisted formulae/casks
|
cleanup = "zap";
|
||||||
upgrade = true;
|
upgrade = true;
|
||||||
};
|
};
|
||||||
greedyCasks = true;
|
greedyCasks = true;
|
||||||
brews = [
|
brews = [
|
||||||
# Command-line tools go here
|
|
||||||
];
|
];
|
||||||
casks = [
|
casks = [
|
||||||
# Development
|
# Development
|
||||||
|
|
@ -51,11 +49,10 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# nix-homebrew configuration for declarative Homebrew installation
|
|
||||||
nix-homebrew = {
|
nix-homebrew = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableRosetta = true; # Apple Silicon support
|
enableRosetta = true;
|
||||||
user = "yanlin";
|
user = "yanlin";
|
||||||
autoMigrate = true; # Migrate existing Homebrew if present
|
autoMigrate = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,9 @@
|
||||||
programs.nixvim = {
|
programs.nixvim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultEditor = true;
|
defaultEditor = true;
|
||||||
|
|
||||||
# scowl provides English word lists for completion on NixOS
|
|
||||||
extraPackages = [ pkgs.scowl ];
|
extraPackages = [ pkgs.scowl ];
|
||||||
|
|
||||||
# Global settings
|
|
||||||
globals.mapleader = " ";
|
globals.mapleader = " ";
|
||||||
|
|
||||||
# Vim options
|
|
||||||
opts = {
|
opts = {
|
||||||
number = true;
|
number = true;
|
||||||
relativenumber = false;
|
relativenumber = false;
|
||||||
|
|
@ -20,35 +15,32 @@
|
||||||
tabstop = 2;
|
tabstop = 2;
|
||||||
smartindent = true;
|
smartindent = true;
|
||||||
wrap = true;
|
wrap = true;
|
||||||
linebreak = true; # Don't break words when wrapping
|
linebreak = true;
|
||||||
breakindent = true; # Preserve indentation when wrapping
|
breakindent = true;
|
||||||
termguicolors = true;
|
termguicolors = true;
|
||||||
signcolumn = "yes";
|
signcolumn = "yes";
|
||||||
autoread = true; # Automatically reload files when changed externally
|
autoread = true;
|
||||||
clipboard = "unnamedplus"; # Use system clipboard by default
|
clipboard = "unnamedplus";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable filetype detection
|
|
||||||
viAlias = true;
|
viAlias = true;
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
|
|
||||||
# Gruvbox colorscheme with hard contrast
|
|
||||||
colorschemes.gruvbox = {
|
colorschemes.gruvbox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
contrast = "hard"; # Makes background much darker (#1d2021 instead of #282828)
|
contrast = "hard";
|
||||||
background = "dark";
|
background = "dark";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Plugins
|
|
||||||
plugins = {
|
plugins = {
|
||||||
|
|
||||||
bufferline = {
|
bufferline = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
options = {
|
options = {
|
||||||
separator_style = [ "" "" ]; # Remove gaps between tabs
|
separator_style = [ "" "" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -57,15 +49,14 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
indent = {
|
indent = {
|
||||||
char = "▏"; # Thinner vertical line
|
char = "▏";
|
||||||
};
|
};
|
||||||
scope = {
|
scope = {
|
||||||
enabled = false; # Disable scope highlighting
|
enabled = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Syntax highlighting
|
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
@ -76,7 +67,7 @@
|
||||||
indent = {
|
indent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
ensure_installed = []; # Managed by Nix
|
ensure_installed = [];
|
||||||
auto_install = false;
|
auto_install = false;
|
||||||
};
|
};
|
||||||
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||||
|
|
@ -84,7 +75,6 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Status line with gruvbox theme and relative paths
|
|
||||||
lualine = {
|
lualine = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
@ -99,38 +89,13 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Web dev icons
|
|
||||||
web-devicons = {
|
web-devicons = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Basic auto-completion
|
|
||||||
cmp = {
|
|
||||||
enable = true;
|
|
||||||
autoEnableSources = true;
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
sources = [
|
|
||||||
{ name = "buffer"; } # Words from open buffers
|
|
||||||
{ name = "path"; } # File system paths
|
|
||||||
{ name = "dictionary"; keyword_length = 2; } # English dictionary words
|
|
||||||
];
|
|
||||||
|
|
||||||
mapping = {
|
|
||||||
"<C-Space>" = "cmp.mapping.complete()"; # Trigger completion manually
|
|
||||||
"<C-e>" = "cmp.mapping.close()"; # Close completion menu
|
|
||||||
"<CR>" = "cmp.mapping.confirm({ select = true })"; # Accept selected completion
|
|
||||||
"<Tab>" = "cmp.mapping.select_next_item()"; # Navigate down in menu
|
|
||||||
"<S-Tab>" = "cmp.mapping.select_prev_item()"; # Navigate up in menu
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Telescope - Fuzzy finder
|
|
||||||
telescope = {
|
telescope = {
|
||||||
enable = true;
|
enable = true;
|
||||||
keymaps = {
|
keymaps = {
|
||||||
# Find files using Telescope command-line sugar
|
|
||||||
"<leader>t" = "find_files";
|
"<leader>t" = "find_files";
|
||||||
"<leader>g" = "live_grep";
|
"<leader>g" = "live_grep";
|
||||||
};
|
};
|
||||||
|
|
@ -174,7 +139,7 @@
|
||||||
render-markdown = {
|
render-markdown = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
enabled = false; # Disabled by default
|
enabled = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -214,7 +179,6 @@
|
||||||
border = "rounded";
|
border = "rounded";
|
||||||
};
|
};
|
||||||
mappings = {
|
mappings = {
|
||||||
# Keep: navigation & file operations
|
|
||||||
"." = "set_root";
|
"." = "set_root";
|
||||||
"<bs>" = "navigate_up";
|
"<bs>" = "navigate_up";
|
||||||
"<cr>" = "open";
|
"<cr>" = "open";
|
||||||
|
|
@ -232,7 +196,6 @@
|
||||||
d = "delete";
|
d = "delete";
|
||||||
o = { command = "system_open"; nowait = true; };
|
o = { command = "system_open"; nowait = true; };
|
||||||
f = { command = "show_in_finder"; nowait = true; };
|
f = { command = "show_in_finder"; nowait = true; };
|
||||||
# Disable everything else
|
|
||||||
"#" = "none";
|
"#" = "none";
|
||||||
"/" = "none";
|
"/" = "none";
|
||||||
"<" = "none";
|
"<" = "none";
|
||||||
|
|
@ -292,31 +255,24 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Extra plugins that don't have dedicated modules
|
|
||||||
extraPlugins = with pkgs.vimPlugins; [
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
vim-fugitive
|
vim-fugitive
|
||||||
cmp-dictionary
|
|
||||||
plenary-nvim
|
plenary-nvim
|
||||||
];
|
];
|
||||||
|
|
||||||
# Keymaps
|
|
||||||
keymaps = [
|
keymaps = [
|
||||||
# File explorer (neo-tree)
|
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>e";
|
key = "<leader>e";
|
||||||
action = ":Neotree toggle reveal<CR>";
|
action = ":Neotree toggle reveal<CR>";
|
||||||
options = { desc = "Toggle file explorer"; };
|
options = { desc = "Toggle file explorer"; };
|
||||||
}
|
}
|
||||||
|
|
||||||
# Markdown rendering
|
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>m";
|
key = "<leader>m";
|
||||||
action = ":RenderMarkdown toggle<CR>";
|
action = ":RenderMarkdown toggle<CR>";
|
||||||
options = { desc = "Toggle markdown rendering"; };
|
options = { desc = "Toggle markdown rendering"; };
|
||||||
}
|
}
|
||||||
# Basic keymaps
|
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<leader>w";
|
key = "<leader>w";
|
||||||
|
|
@ -335,8 +291,6 @@
|
||||||
action = ":e<CR>";
|
action = ":e<CR>";
|
||||||
options = { desc = "Refresh"; };
|
options = { desc = "Refresh"; };
|
||||||
}
|
}
|
||||||
|
|
||||||
# Buffer/Tab navigation
|
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
key = "<S-h>";
|
key = "<S-h>";
|
||||||
|
|
@ -364,25 +318,7 @@
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Additional Lua configuration for plugins that need custom setup
|
|
||||||
extraConfigLua = ''
|
extraConfigLua = ''
|
||||||
-- Dictionary completion setup
|
|
||||||
${lib.optionalString pkgs.stdenv.isDarwin ''
|
|
||||||
require("cmp_dictionary").setup({
|
|
||||||
paths = { "/usr/share/dict/words" }, -- Standard dictionary path on macOS
|
|
||||||
exact_length = 2, -- Minimum length before completion
|
|
||||||
first_case_insensitive = true, -- Case insensitive matching
|
|
||||||
})
|
|
||||||
''}
|
|
||||||
${lib.optionalString (!pkgs.stdenv.isDarwin) ''
|
|
||||||
require("cmp_dictionary").setup({
|
|
||||||
paths = { "${pkgs.scowl}/share/dict/wamerican.txt" }, -- Nix-provided dictionary on NixOS
|
|
||||||
exact_length = 2, -- Minimum length before completion
|
|
||||||
first_case_insensitive = true, -- Case insensitive matching
|
|
||||||
})
|
|
||||||
''}
|
|
||||||
|
|
||||||
-- Telescope setup for better file finding
|
|
||||||
local telescope = require('telescope')
|
local telescope = require('telescope')
|
||||||
local actions = require('telescope.actions')
|
local actions = require('telescope.actions')
|
||||||
|
|
||||||
|
|
@ -397,9 +333,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
-- OSC-52 clipboard integration (matches tmux setup, works with Ghostty)
|
|
||||||
-- This enables clipboard functionality across SSH, tmux, and multi-platform
|
|
||||||
-- Only enabled on Linux; macOS uses native clipboard with "unnamedplus"
|
|
||||||
${lib.optionalString (!pkgs.stdenv.isDarwin) ''
|
${lib.optionalString (!pkgs.stdenv.isDarwin) ''
|
||||||
vim.g.clipboard = {
|
vim.g.clipboard = {
|
||||||
name = 'OSC 52',
|
name = 'OSC 52',
|
||||||
|
|
@ -414,7 +347,6 @@
|
||||||
}
|
}
|
||||||
''}
|
''}
|
||||||
|
|
||||||
-- Close all buffers except current (preserving special buffers)
|
|
||||||
function close_other_buffers()
|
function close_other_buffers()
|
||||||
local current_buf = vim.api.nvim_get_current_buf()
|
local current_buf = vim.api.nvim_get_current_buf()
|
||||||
local buffers = vim.api.nvim_list_bufs()
|
local buffers = vim.api.nvim_list_bufs()
|
||||||
|
|
@ -423,7 +355,6 @@
|
||||||
if buf ~= current_buf and vim.api.nvim_buf_is_valid(buf) then
|
if buf ~= current_buf and vim.api.nvim_buf_is_valid(buf) then
|
||||||
local buftype = vim.api.nvim_buf_get_option(buf, 'buftype')
|
local buftype = vim.api.nvim_buf_get_option(buf, 'buftype')
|
||||||
|
|
||||||
-- Skip special buffers (terminals, quickfix, etc.)
|
|
||||||
if buftype == "" then
|
if buftype == "" then
|
||||||
vim.api.nvim_buf_delete(buf, { force = false })
|
vim.api.nvim_buf_delete(buf, { force = false })
|
||||||
end
|
end
|
||||||
|
|
@ -431,7 +362,6 @@
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Disable italic for code blocks and strings
|
|
||||||
vim.api.nvim_set_hl(0, "@markup.raw", { italic = false })
|
vim.api.nvim_set_hl(0, "@markup.raw", { italic = false })
|
||||||
vim.api.nvim_set_hl(0, "@markup.raw.block", { italic = false })
|
vim.api.nvim_set_hl(0, "@markup.raw.block", { italic = false })
|
||||||
vim.api.nvim_set_hl(0, "@markup.raw.markdown_inline", { italic = false })
|
vim.api.nvim_set_hl(0, "@markup.raw.markdown_inline", { italic = false })
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.file.".config/linearmouse/linearmouse.json".text = builtins.toJSON {
|
|
||||||
"$schema" = "https://app.linearmouse.org/schema/0.10.0";
|
|
||||||
schemes = [{
|
|
||||||
"if" = {
|
|
||||||
device.category = "mouse";
|
|
||||||
};
|
|
||||||
scrolling.reverse.vertical = true;
|
|
||||||
pointer = {
|
|
||||||
acceleration = 0;
|
|
||||||
speed = 0.6;
|
|
||||||
};
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Key remapping using hidutil via launchd agent
|
|
||||||
# Swaps Caps Lock -> Left Control, Right Control -> Caps Lock
|
|
||||||
launchd.user.agents.remap-keys = {
|
|
||||||
serviceConfig = {
|
|
||||||
ProgramArguments = [
|
|
||||||
"/usr/bin/hidutil"
|
|
||||||
"property"
|
|
||||||
"--set"
|
|
||||||
''{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x7000000E0},{"HIDKeyboardModifierMappingSrc":0x7000000E4,"HIDKeyboardModifierMappingDst":0x700000039}]}''
|
|
||||||
];
|
|
||||||
RunAtLoad = true;
|
|
||||||
KeepAlive = false;
|
|
||||||
Label = "org.nixos.remap-keys";
|
|
||||||
StandardErrorPath = "/tmp/remap-keys.err";
|
|
||||||
StandardOutPath = "/tmp/remap-keys.out";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
{ config, pkgs, lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Install rsync package
|
|
||||||
home.packages = with pkgs; [ rsync ];
|
|
||||||
|
|
||||||
programs.zsh.initContent = ''
|
|
||||||
function rsync-backup() {
|
|
||||||
if [[ $# -ne 2 ]]; then
|
|
||||||
echo "Usage: rsync-backup <source/> <destination/>"
|
|
||||||
echo "Example: rsync-backup ~/Documents/ /backup/documents/"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local SOURCE="$1"
|
|
||||||
local DEST="$2"
|
|
||||||
|
|
||||||
if [[ "$SOURCE" != */ ]]; then
|
|
||||||
SOURCE="$SOURCE/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Rsync Backup ==="
|
|
||||||
echo "Source: $SOURCE"
|
|
||||||
echo "Destination: $DEST"
|
|
||||||
echo "==================="
|
|
||||||
|
|
||||||
rsync -avh --progress --delete --partial --partial-dir=.rsync-partial --compress "$SOURCE" "$DEST"
|
|
||||||
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
echo "Backup completed successfully!"
|
|
||||||
else
|
|
||||||
echo "Backup failed with exit code $?"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
programs.zsh.shellAliases = {
|
|
||||||
rsync-quick = "rsync -avh --progress";
|
|
||||||
rsync-dry = "rsync -avh --progress --dry-run";
|
|
||||||
rsync-full = "rsync-backup";
|
|
||||||
rsync-sync = "rsync -avh --progress";
|
|
||||||
rsync-mirror = "rsync -avh --progress --delete";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -6,19 +6,15 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Traefik reverse proxy service
|
|
||||||
services.traefik = {
|
services.traefik = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
# Static configuration
|
|
||||||
staticConfigOptions = {
|
staticConfigOptions = {
|
||||||
# Enable Docker provider for automatic service discovery
|
|
||||||
providers.docker = {
|
providers.docker = {
|
||||||
endpoint = "unix:///var/run/docker.sock";
|
endpoint = "unix:///var/run/docker.sock";
|
||||||
exposedByDefault = false; # Only expose containers with traefik.enable=true
|
exposedByDefault = false;
|
||||||
network = "podman"; # Use podman network
|
network = "podman";
|
||||||
};
|
};
|
||||||
# Entry points for HTTP and HTTPS
|
|
||||||
entrypoints = {
|
entrypoints = {
|
||||||
web = {
|
web = {
|
||||||
address = ":80";
|
address = ":80";
|
||||||
|
|
@ -34,7 +30,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Certificate resolver using Cloudflare DNS challenge
|
|
||||||
certificatesResolvers.cloudflare = {
|
certificatesResolvers.cloudflare = {
|
||||||
acme = {
|
acme = {
|
||||||
email = "cloudflare@yanlincs.com";
|
email = "cloudflare@yanlincs.com";
|
||||||
|
|
@ -50,36 +45,27 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# API and dashboard
|
|
||||||
api = {
|
api = {
|
||||||
dashboard = true;
|
dashboard = true;
|
||||||
debug = false;
|
debug = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Logging
|
|
||||||
log = {
|
log = {
|
||||||
level = "INFO";
|
level = "INFO";
|
||||||
};
|
};
|
||||||
accessLog = {};
|
accessLog = {};
|
||||||
|
|
||||||
# Global settings
|
|
||||||
global = {
|
global = {
|
||||||
checkNewVersion = false;
|
checkNewVersion = false;
|
||||||
sendAnonymousUsage = false;
|
sendAnonymousUsage = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Dynamic configuration is now defined in host-specific proxy.nix files
|
|
||||||
# and will be merged with this base configuration
|
|
||||||
|
|
||||||
# Environment variables for Cloudflare
|
|
||||||
environmentFiles = [ "/etc/traefik-env" ];
|
environmentFiles = [ "/etc/traefik-env" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Ensure Traefik can access Docker socket
|
|
||||||
systemd.services.traefik.serviceConfig = {
|
systemd.services.traefik.serviceConfig = {
|
||||||
SupplementaryGroups = [ "podman" ];
|
SupplementaryGroups = [ "podman" ];
|
||||||
# Mount Docker/Podman socket for service discovery
|
|
||||||
BindPaths = [ "/run/podman/podman.sock:/var/run/docker.sock" ];
|
BindPaths = [ "/run/podman/podman.sock:/var/run/docker.sock" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue