nix-config/home.nix
2024-05-17 16:37:59 +02:00

455 lines
12 KiB
Nix

{ config, pkgs, lib, ... }:
{
home.username = "muhh";
home.homeDirectory = "/home/muhh";
home.activation.setupEtc = config.lib.dag.entryAfter [ "writeBoundary" ] ''
/run/current-system/sw/bin/systemctl start --user sops-nix
'';
home.packages = with pkgs; [
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # 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}!"
# '')
_1password
_1password-gui
atkinson-hyperlegible
brightnessctl
curl
distrobox
fd
git
neovide
(nerdfonts.override { fonts = [ "Iosevka" ]; })
obsidian
powertop
qutebrowser
solargraph
sops
tmux
wget
wl-clipboard
zellij
zulip-term
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# 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/muhh/etc/profile.d/hm-session-vars.sh
#
# if you don't want to manage your shell through Home Manager.
home.sessionVariables = {
EDITOR = "nvim";
};
accounts = {
email = {
accounts = {
privat = {
primary = true;
address = "markus@heurung.net";
realName = "Markus Heurung";
userName = "markus@heurung.net";
passwordCommand = ''(/run/current-system/sw/bin/cat $XDG_RUNTIME_DIR/secrets/mail/privat/password)'';
imap.host = "imap.mailbox.org";
# neomutt.enable = true;
mbsync = {
enable = true;
create = "both";
};
};
};
};
};
programs = {
atuin = {
enable = true;
enableFishIntegration = true;
flags = [
"--disable-up-arrow"
];
};
bat = {
enable = true;
config.theme = "Catppuccin-mocha";
themes = {
Catppuccin-mocha = {
src = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "bat";
rev = "main";
sha256 = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
};
file = "Catppuccin-mocha.tmTheme";
};
};
};
btop = {
enable = true;
};
direnv = {
enable = true;
nix-direnv.enable = true;
};
fish = {
enable = true;
loginShellInit = ''
if test (tty) = /dev/tty1
exec sway
end
'';
shellAliases = {
cat = "bat";
};
};
fzf = {
enable = true;
enableFishIntegration = true;
};
git = {
enable = true;
userEmail = "markus@heurung.net";
userName = "Markus Heurung";
extraConfig = {
apply.whitespace = "warn";
color = {
diff = "auto";
status = "auto";
branch = "auto";
ui = "always";
};
fetch.prune = true;
init.defaultBranch = "main";
pull.ff = "only";
push.default = "current";
status.submodule = "1";
user.useConfigOnly = true;
};
delta = {
enable = true;
options = {
light = false;
line-numbers = true;
navigate = true;
};
};
ignores = [
"*~"
".DS_Store"
".sublime-*"
"*.swp"
];
};
keychain = {
enable = true;
enableFishIntegration = true;
keys = [
"id_ed25519"
];
};
kitty = {
enable = true;
shellIntegration.enableFishIntegration = true;
font = {
name = "Iosevka Nerd Font";
size = 14;
};
keybindings = {
"ctrl+shift+g" = "show_last_command_output";
"ctrl+alt+enter" = "launch --cwd=current";
"ctrl+alt+t" = "launch --type=tab --cwd=current";
"ctrl+h" = "neighboring_window left";
"ctrl+j" = "neighboring_window bottom";
"ctrl+k" = "neighboring_window top";
"ctrl+l" = "neighboring_window right";
"ctrl+shift+h" = "move_window left";
"ctrl+shift+j" = "move_window down";
"ctrl+shift+k" = "move_window up";
"ctrl+shift+l" = "move_window right";
"ctrl+shift+z" = "next_layout";
};
settings = {
background_opacity = "0.95";
dynamic_background_opacity = true;
enabled_layouts = "tall:bias=50;full_size=1";
scrollback_lines = 10000;
scrollback_pager_history_size = 4096;
strip_trailing_space = "smart";
tab_bar_edge = "bottom";
tab_bar_min_tabs = 2;
tab_bar_style = "powerline";
tab_powerline_style = "round";
tab_title_template = "{title}{' :{}:'.format(num_windows) if num_windows > 1 else ''}";
};
theme = "Catppuccin-Mocha";
};
lazygit = {
enable = true;
};
lsd = {
enable = true;
enableAliases = true;
};
neomutt = {
enable = true;
vimKeys = true;
sidebar.enable = true;
};
nixvim = {
enable = true;
vimAlias = true;
viAlias = true;
clipboard.providers.wl-copy.enable = true;
colorschemes = {
catppuccin = {
enable = true;
settings = {
flavour = "mocha";
show_end_of_buffer = true;
};
};
};
globals.mapleader = " ";
globals.maplocalleader = " ";
keymaps = [
{
key = "<leader>ff";
action = "<cmd>Telescope find_files<cr>";
}
{
key = "<leader>fg";
action = "<cmd>Telescope live_grep<cr>";
}
{
key = "<leader>fb";
action = "<cmd>Telescope buffers<cr>";
}
{
key = "<leader>fh";
action = "<cmd>Telescope help_tags<cr>";
}
{
key = "\\";
action = "<cmd>Neotree toggle<cr>";
}
];
opts = {
expandtab = true;
ignorecase = true;
number = true;
relativenumber = true;
ruler = true;
shiftwidth = 2;
smartcase = true;
tabstop = 2;
};
plugins = {
comment.enable = true;
cmp-cmdline.enable = true;
cmp-fish.enable = true;
cmp-nvim-lsp.enable = true;
cmp-nvim-ultisnips.enable = true;
lightline.enable = true;
fugitive.enable = true;
gitblame.enable = true;
gitsigns.enable = true;
lsp = {
enable = true;
servers = {
html.enable = true;
jsonls.enable = true;
marksman.enable = true;
solargraph.enable = true;
yamlls.enable = true;
};
};
neo-tree = {
enable = true;
enableGitStatus = true;
gitStatusAsync = true;
enableModifiedMarkers = true;
closeIfLastWindow = true;
};
nix.enable = true;
noice.enable = true;
notify.enable = true;
nvim-autopairs.enable = true;
nvim-colorizer.enable = true;
obsidian = {
enable = true;
settings = {
dir = "~/muhhMory";
daily_notes = {
folder = "~/muhhmory/Journal/Daily Pages";
template = "Daily Page.md";
};
templates = {
subdir = "Templates";
};
};
};
oil.enable = true;
surround.enable = true;
telescope = {
enable = true;
extensions = {
# file_browser.enable = true;
fzf-native.enable = true;
};
};
transparent.enable = true;
toggleterm.enable = true;
treesitter = {
enable = true;
indent = true;
};
};
extraPlugins = with pkgs.vimPlugins; [
];
};
mbsync = {
enable = true;
};
ripgrep.enable = true;
starship = {
enable = true;
enableFishIntegration = true;
};
swaylock.enable = true;
zoxide = {
enable = true;
};
};
services = {
mbsync = {
enable = true;
preExec = "";
postExec = "";
};
espanso = {
enable = true;
package = pkgs.espanso-wayland;
matches = {
base = {
matches = [
{
trigger = ";dat";
replace = "{{mydate}}";
vars = [
{
name = "mydate";
type = "date";
params.format = "%F";
}
];
}
];
};
};
};
playerctld.enable = true;
swayidle = {
enable = true;
};
syncthing = {
enable = true;
# dataDir = "/home/muhh/Sync";
# configDir = "/home/muhh/.config/syncthing";
};
};
sops = {
age.keyFile = "${config.xdg.configHome}/sops/age/keys.txt";
defaultSopsFile = ./secrets/secrets.yaml;
secrets = {
just_a_test = {};
"mail/privat/address" = {};
"mail/privat/username" = {};
"mail/privat/password" = {};
"mail/icloud/address" = {};
"mail/icloud/username" = {};
"mail/icloud/password" = {};
};
};
wayland.windowManager = {
sway = {
enable = true;
config = {
gaps = {
smartBorders = "on";
};
input = {
"type:keyboard" = {
xkb_variant = "eu";
xkb_options = "compose:ralt";
};
"type:touchpad" = {
tap = "enabled";
natural_scroll = "enabled";
dwt = "enabled";
accel_profile = "adaptive";
pointer_accel = "0.5";
};
};
keybindings = let
modifier = config.wayland.windowManager.sway.config.modifier;
in lib.mkOptionDefault {
"XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
"XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
"XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
"XF86MonBrightnessUp" = "exec brightnessctl set 10%+";
"XF86MonBrightnessDown" = "exec brightnessctl set 10%-";
"XF86AudioPlay" = "exec playerctl play-pause";
"XF86AudioNext" = "exec playerctl next";
"XF86AudioPrev" = "exec playerctl previous";
};
modifier = "Mod4";
seat = {
"*" = {
hide_cursor = "5000";
};
};
terminal = "kitty";
window = {
titlebar = false;
};
};
};
};
# leave things below alone.
home.stateVersion = "23.05";
programs.home-manager.enable = true;
}