nix-home/home.nix

361 lines
8.6 KiB
Nix

{ config, pkgs, ... }:
{
home.username = "serge";
home.homeDirectory = "/home/serge";
# 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 = "22.11";
home.packages = with pkgs; [
(pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
gnomeExtensions.user-themes
gnomeExtensions.caffeine
];
fonts.fontconfig.enable = true;
home.file = {
".config/helix/".source = ./helix;
# the actual config file is managed by `programs.alacritty`
".config/alacritty/themes/".source = ./alacritty/themes;
};
# You can also manage environment variables but you will have to manually
# source
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/serge/etc/profile.d/hm-session-vars.sh
#
# if you don't want to manage your shell through Home Manager.
home.sessionVariables = {
EDITOR = "hx";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.fish = {
enable = true;
plugins = [
{ name = "tide"; src = pkgs.fishPlugins.tide.src; }
# { name = "fzf"; src = pkgs.fishplugins.fzf-fish.src; }
{ name = "z"; src = pkgs.fishPlugins.z.src; }
];
# TODO: check your config from dotfiles
};
# TODO: install keyd or another way to use CapsLock for Esc
# TODO: color-scheme-monitor?
programs.alacritty = {
enable = true;
settings = {
env.TERM = "xterm-256color";
window.decorations = "full";
font.normal.family = "FiraCode Nerd Font";
font.normal.style = "Regular";
font.bold.family = "FiraCode Nerd Font";
font.bold.style = "Bold";
font.italic.family = "FiraCode Nerd Font";
font.italic.style = "MediumItalic";
font.bold_italic.family = "FiraCode Nerd Font";
font.bold_italic.style = "BoldItalic";
font.size = 14.0;
font.offset = {
x = 0;
y = 4;
};
scrolling = {
history = 10000;
multiplier = 3;
};
draw_bold_text_with_bright_colors = true;
shell = "${pkgs.fish}/bin/fish";
import = ["~/.config/alacritty/themes/everforest_dark.yml"];
key_bindings = [
{
key = "F11";
action = "ToggleFullscreen";
}
];
# TODO: check wezterm for an alternative
};
};
programs.lazygit = {
enable = true;
settings = {
git = {
paging = {
colorArg = "always";
pager = "delta --dark --paging=never";
};
overrideGpg = true;
};
};
};
programs.git = {
enable = true;
userName = "Serhii Korzh";
userEmail = "serge.korzh@pm.me";
# TODO: check aliases that I'm used to and change email according to project used
delta = {
enable = true;
options = {
navigate = true;
syntax-theme = "base16";
features = "side-by-side line-numbers decorations";
whitespace-error-style = "22 reverse";
decorations = {
commit-decoration-style = "bold yellow box ul";
file-style = "bold yellow ul";
file-decoration-style = "none";
};
};
};
signing = {
signByDefault = true;
key = null;
};
extraConfig = {
core = {
whitespace = "space-before-tab, trailing-space";
};
credential = {
helper = "cache --timeout=1800";
};
commit = {
verbose = true;
};
diff = {
algorithm = "histogram";
renames = "copies";
mnemonicprefix = true;
colormoved = "default";
};
push = {
default = "simple";
autoSetupRemote = true;
};
merge = {
conflictstyle = "zdiff3";
};
rerere = {
enabled = 1;
};
pull = {
rebase = true;
};
rebase = {
autostash = true;
updateRefs = true;
};
transfer = {
credentialsInUrl = "warn";
};
absorb = {
maxstack = 50;
};
};
aliases = {
a = "add";
ap = "add --patch";
b = "branch -vv";
bd = "branch -d";
bdd = "branch -D";
c = "commit";
ca = "commit --amend";
co = "checkout";
cp = "cherry-pick";
d = "diff";
dc = "diff --cached";
ds = "diff --staged";
f = "fetch";
fx = "commit --fixup";
g = "grep -n";
hrd = "reset --hard";
l = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %C(yellow)%an%Creset' --all --abbrev-commit --date=relative";
ls = "log --stat --oneline"; # show log with filediffs only
m = "merge";
mm = "merge origin/master";
p = "push";
pf = "push --force-with-lease";
pl = "pull --rebase";
r = "rebase";
ra = "rebase --abort";
rc = "rebase --continue";
ri = "rebase --interactive --autosquash";
rom = "rebase origin/master";
rs = "rebase --skip";
s = "status";
sh = "!git-sh";
sq = "commit --squash";
st = "diff-tree --no-commit-id --name-only -r"; # show file tree of commit
sw = "show";
w = "whatchanged";
undo = "reset --soft HEAD^";
standup = "shortlog --since='1 week ago'";
who = "shortlog -s -n --no-merges";
};
};
programs.gpg = {
enable = true;
settings = {
no-emit-version = true;
no-comments = true;
display-charset = "utf-8";
keyid-format = "0xlong";
with-fingerprint = true;
use-agent = true;
};
};
services.gpg-agent = {
enable = true;
defaultCacheTtl = 1800;
enableSshSupport = true;
};
programs.fzf = {
enable = true;
};
programs.bat = {
enable = true;
};
programs.nnn = {
enable = true;
};
programs.zellij = {
enable = true;
# enableFishIntegration = true;
settings = {
default_shell = "fish";
theme = "everforest-dark";
themes.everforest-dark = {
bg = "#2b3339";
fg = "#d3c6aa";
black = "#4b565c";
red = "#e67e80";
green = "#a7c080";
yellow = "#dbbc7f";
blue = "#7fbbb3";
magenta = "#d699b6";
cyan = "#83c092";
white = "#d3c6aa";
orange = "#FF9E64";
};
};
};
programs.vscode = {
enable = true;
package = pkgs.vscodium;
};
programs.helix = {
enable = true;
package = pkgs.helix;
extraPackages = with pkgs; [
nodePackages."bash-language-server"
nodePackages."@volar/vue-language-server"
nodePackages."@tailwindcss/language-server"
nodePackages."typescript-language-server"
vscode-langservers-extracted
efm-langserver # Used by Prettier
python311Packages.python-lsp-server
dockerfile-language-server-nodejs
elmPackages.elm-language-server
yaml-language-server
marksman # Markdown
nil # Nix
## These seem to be not working
# nodePackages_latest.vscode-css-languageserver-bin
# nodePackages_latest.vscode-html-languageserver-bin
# nodePackages_latest.vscode-json-languageserver
## Provided by rustup installed as a system package
# rust-analyzer
## Not used for now
# texlab # LaTeX
# elixir-ls
# lua-language-server
# haskell-language-server
## Not working
nodePackages_latest.vls # Vue, not working
# graphql-lsp
## Debugger - not thested if it's working
lldb
# lldb_16
## Hopefully, I'll never make use of that. UPD: it's unfree lol, won't install
# nodePackages_latest.intelephense
];
};
gtk = {
enable = true;
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
cursorTheme = {
name = "Numix-Cursor";
package = pkgs.numix-cursor-theme;
};
};
home.pointerCursor = {
name = "Numix-Cursor";
package = pkgs.numix-cursor-theme;
size = 36;
x11.enable = true;
};
dconf.settings = {
"org/gnome/shell" = {
disable-user-extensions = false;
enabled-extensions = [
"caffeine@patapon.info"
"user-theme@gnome-shell-extensions.gcampax.github.com"
];
};
"org/gnome/desktop/interface" = {
enable-hot-corners = false;
};
};
}