home-manager/home.nix
2025-06-18 12:42:53 -04:00

295 lines
7.5 KiB
Nix
Executable file

{
pkgs,
lib,
config,
...
}: let
HOME = "/home/mtgmonkey";
USERNAME = "mtgmonkey";
HOSTNAME = "nixos";
in {
imports = [./home/stylix.nix];
programs = {
bash = {
enable = true;
shellAliases = {
# replacements
neofetch = lib.mkForce "fastfetch";
ls = lib.mkForce "lsd";
ll = lib.mkForce "lsd -l";
l = lib.mkForce "lsd -la";
cd = lib.mkForce "z";
# gen
gg = lib.mkForce "git log --oneline --abbrev-commit --all --graph --decorate --color";
md = lib.mkForce "glow";
# nixos/hm
hm = lib.mkForce "home-manager";
hm-check = lib.mkForce "nix check flake ${HOME}/dotfiles/.";
hm-switch = lib.mkForce "home-manager switch --flake ${HOME}/.dotfiles/. -f ${HOME}/.dotfiles/home.nix";
nix-check = lib.mkForce "nix check flake /etc/nixos/.";
nix-switch = lib.mkForce "nixos-rebuild switch --flake /etc/nixos/.";
};
bashrcExtra = ''
PS1="\u@\h:\w$ "
eval "$(zoxide init bash)"
'';
};
btop = {
enable = true;
settings = {
theme_background = false;
vim_keys = true;
rounded_corners = false;
graph_symbol = "braille";
update_ms = 200;
proc_sorting = "cpu lazy";
proc_gradient = false;
proc_left = true;
cpu_single_graph = true;
cpu_bottom = true;
clock_format = "/user@/host:/uptime@%H:%M";
background_update = false;
mem_graphs = false;
mem_below_net = true;
show_swap = true;
only_physical = true;
show_io_stat = true;
io_mode = false;
io_graph_combined = false;
log_level = "ERROR";
};
};
# alias
git = {
enable = true;
userName = USERNAME;
userEmail = "${USERNAME}@${HOSTNAME}";
extraConfig = {
init.defaultBranch = "master";
http.postBuffer = 524288000;
};
};
gh.enable = true;
nvf = {
enable = true;
settings.vim = {
autocomplete.nvim-cmp.enable = false;
formatter.conform-nvim = {
enable = true;
setupOpts.format_on_save = {
lsp_format = "fallback";
timeout_ms = 5000;
};
};
lsp.otter-nvim.enable = true;
git.enable = true;
keymaps = [
{
key = "<Down>";
mode = ["i" "n" "v" "c"];
action = "<NOP>";
}
{
key = "<Up>";
mode = ["i" "n" "v" "c"];
action = "<NOP>";
}
{
key = "<Left>";
mode = ["i" "n" "v" "c"];
action = "<NOP>";
}
{
key = "<Right>";
mode = ["i" "n" "v" "c"];
action = "<NOP>";
}
{
key = "jj";
mode = ["i"];
action = "<Esc>";
}
{
key = "kk";
mode = ["i"];
action = "<Esc>";
}
{
key = "jk";
mode = ["i"];
action = "<Esc>";
}
{
key = "kj";
mode = ["i"];
action = "<Esc>";
}
{
key = "<Esc>";
mode = ["i"];
action = "<Nop>";
}
];
languages = {
assembly.enable = true;
nix = {
enable = true;
format.enable = true;
lsp.enable = true;
};
rust = {
enable = true;
format.enable = true;
lsp.enable = true;
};
haskell = {
enable = true;
lsp.enable = true;
};
};
lineNumberMode = "relative";
options = {
tabstop = 2;
shiftwidth = 2;
expandtab = true;
smarttab = true;
foldmethod = "indent";
number = true;
};
statusline.lualine.enable = true;
syntaxHighlighting = true;
};
};
home-manager.enable = true;
qutebrowser.enable = true;
ssh.enable = true;
niri.settings = {
input = {
touchpad.tap = true;
focus-follows-mouse = {};
};
outputs."eDP-1" = {
scale = 1;
};
layout = {
gaps = 2;
center-focused-column = "always";
focus-ring.width = 1;
};
binds = with config.lib.niri.actions; {
"Print".action = screenshot;
"Mod+O" = {
repeat = false;
action = toggle-overview;
};
"Mod+R".action = switch-preset-column-width;
"Mod+F".action = fullscreen-window;
"Mod+Minus".action = set-column-width "-5%";
"Mod+Equal".action = set-column-width "+5%";
"Mod+1".action = focus-workspace 1;
"Mod+2".action = focus-workspace 2;
"Mod+3".action = focus-workspace 3;
"Mod+4".action = focus-workspace 4;
"Mod+5".action = focus-workspace 5;
"Mod+6".action = focus-workspace 6;
"Mod+7".action = focus-workspace 7;
"Mod+8".action = focus-workspace 8;
"Mod+9".action = focus-workspace 9;
"Mod+0".action = focus-workspace 10;
"Mod+H".action = focus-column-left;
"Mod+L".action = focus-column-right;
"Mod+J".action = focus-workspace-down;
"Mod+K".action = focus-workspace-up;
"Mod+Shift+H".action = move-column-left;
"Mod+Shift+L".action = move-column-right;
"Mod+Shift+J".action = move-column-to-workspace-down;
"Mod+Shift+K".action = move-column-to-workspace-up;
"Mod+Shift+Return".action = spawn "kitty" "brush";
"Mod+Shift+R".action = spawn "rofi" "-show" "run";
"Mod+Shift+Q".action = spawn "qutebrowser";
"Mod+Shift+C" = {
repeat = false;
action = close-window;
};
"XF86AudioRaiseVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+";
"XF86AudioLowerVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-";
"XF86AudioMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle";
"XF86AudioMicMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle";
"XF86MonBrightnessUp".action = spawn "brightnessctl" "--class=backlight" "set" "2%+";
"XF86MonBrightnessDown".action = spawn "brightnessctl" "--class=backlight" "set" "2%-";
"Mod+Alt+Shift+Q".action = quit;
"Mod+Alt+Shift+Slash".action = show-hotkey-overlay;
};
};
kitty = {
enable = true;
settings = {
scrollback_lines = 10000;
enable_audio_bell = 0;
confirm_os_window_close = 0;
};
};
# alias
# replacements
fastfetch.enable = true;
lsd.enable = true;
};
services = {
udiskie = {
enable = false;
settings.program_options.file_manager = "${pkgs.ranger}/bin/ranger";
};
};
xsession.windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
config = ./home/xmonad/config.hs;
};
xdg.configFile."shell".source = lib.getExe pkgs.brush;
home = {
username = USERNAME;
homeDirectory = HOME;
stateVersion = "25.05";
packages = [
pkgs.acpi
pkgs.brush
pkgs.brightnessctl
pkgs.dust
pkgs.flameshot
pkgs.fzf
pkgs.jmtpfs
pkgs.nix-output-monitor
pkgs.lynx
pkgs.rip2
pkgs.ripgrep
pkgs.rofi-wayland
pkgs.tree
# alias
pkgs.glow
pkgs.zoxide
];
};
}