NixOS/home.nix
2026-07-28 14:31:21 +03:00

166 lines
5.2 KiB
Nix

{ config, pkgs, ... }:
{
# home.username and home.homeDirectory are set automatically by the
# Home Manager NixOS module, from the home-manager.users.<name> attribute.
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "26.05"; # Please read the comment before changing.
# Packages that have no Home Manager module (or that need no config).
# Programs configured via `programs.<name>.enable` below are installed
# automatically, so they do not belong here.
home.packages = [
pkgs.bubblewrap
pkgs.claude-code
pkgs.gh
pkgs.jq
pkgs.nodejs_26
pkgs.pi-coding-agent
pkgs.proton-vpn
pkgs.vscodium
];
#############################################################################
# Terminal
#############################################################################
programs.alacritty = {
enable = true;
# This attribute set is translated into ~/.config/alacritty/alacritty.toml
settings = {
window = {
padding = { x = 10; y = 10; };
decorations = "None";
};
colors.primary.background = "#000000";
font.size = 11;
terminal.shell = {
program = "${pkgs.bash}/bin/bash";
args = [ "-l" "-c" "tmux attach || tmux" ];
};
};
};
#############################################################################
# tmux
#############################################################################
programs.tmux = {
enable = true;
prefix = "C-a";
mouse = true;
extraConfig = ''
bind r source-file ~/.tmux.conf \; display-message "RELOADING CONFIGURATION FILE"
set -g status-style bg=white,fg=black
set -g window-active-style bg=black
set -g window-style bg=#212121
set -g pane-border-style fg=gray
set -g pane-border-lines heavy
set -g pane-active-border-style fg=yellow
set -g pane-border-status bottom
set -g pane-border-format ${"''"}
set -g window-status-current-format '[#I:#W]'
set -g window-status-format '#I:#W'
set -g window-status-current-style fg=yellow
set -g @plugin 'tmux-plugins/tpm'
set-option -g status-right ""
set-option -g status-left ""
set -g status-style bg=default
bind-key H display-popup -E "htop"
bind-key N display-popup -E 'tmux new-session -A -s scratch ~/go/bin/klod \; set status off'
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "~/Documents"
run '~/.tmux/plugins/tpm/tpm'
'';
};
#############################################################################
# Neovim
#############################################################################
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
defaultEditor = true;
# The actual vimscript lives in dotfiles/init.vim so your editor can
# highlight it and no Nix string escaping is needed.
extraConfig = builtins.readFile ./dotfiles/init.vim;
plugins = with pkgs.vimPlugins; [
# vim-sensible
# telescope-nvim
];
};
#############################################################################
# Shell
#############################################################################
programs.bash = {
enable = true;
initExtra = builtins.readFile ./dotfiles/bash_prompt + ''
function gcam() { git commit -a -m "$1"; }
function dt() { nohup "$@" </dev/null >/dev/null 2>&1 & disown; }
function mkcdir() { mkdir "$1" && cd "$1"; }
function csa() { cd $1 && ls -a; }
function cs() { cd $1 && ls; }
'';
shellAliases = {
c = "clear";
gm = "git checkout master && git pull";
count = "ls -1 | wc -l";
nrs = "sudo nixos-rebuild switch --flake . --impure";
};
};
#############################################################################
# Git
#############################################################################
programs.git = {
enable = true;
userName = "Leo Alho";
userEmail = "leoalho@proton.me";
lfs.enable = true;
aliases = {
co = "checkout";
br = "branch";
c = "commit";
a = "add";
p = "push";
st = "status";
};
extraConfig = {
init.defaultBranch = "main";
};
};
# Plain files that have no dedicated module can still be managed here, either
# inline with `.text` or - preferably - from a file in dotfiles/:
#
# home.file.".screenrc".source = ./dotfiles/screenrc;
# xdg.configFile."foo".source = ./dotfiles/foo; # whole directory
#
# For a config you tweak constantly, symlink to the working tree instead so
# edits apply without a rebuild:
#
# home.file.".config/nvim".source =
# config.lib.file.mkOutOfStoreSymlink "/home/leo/NixOS/dotfiles/nvim";
home.file = { };
home.sessionVariables = {
# EDITOR is set by programs.neovim.defaultEditor
};
}