nix-config/home.nix

726 lines
19 KiB
Nix

{ config, pkgs, lib, ... }:
{
home = {
username = "muhh";
homeDirectory = "/home/muhh";
activation.setupEtc = config.lib.dag.entryAfter [ "writeBoundary" ] ''
/run/current-system/sw/bin/systemctl start --user sops-nix
'';
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
alacritty
blueman
brightnessctl
curl
darktable
ddcutil
devenv
distrobox
dog
downonspot
fd
ffmpegthumbnailer
fuzzel
git
heroku
htop
httpie
just
libreoffice
neovide
(nerdfonts.override { fonts = [ "Iosevka" ]; })
maid
mediainfo
mpv
morgen
obsidian
offpunk
pamixer
pavucontrol
powertop
qutebrowser
rclone
rockbox-utility
signal-desktop
solargraph
sops
spot
sxiv
steam-run
tmux
unzip
via
wget
whois
wl-clipboard
wl-mirror
sway-launcher-desktop
swaynotificationcenter
swayosd
vivaldi
xdg-utils
zellij
zulip
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
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.
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"
];
settings = {
auto_sync = true;
history_filter = [
"^..$"
"^cd "
"^ls "
"^mv "
"^rm "
];
key_path = config.sops.secrets.atuin_key.path;
};
};
bat = {
enable = true;
};
btop = {
enable = true;
};
direnv = {
enable = true;
nix-direnv.enable = true;
};
firefox = {
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";
pull.rebase = true;
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"
"id_rsa"
];
};
kitty = {
enable = true;
shellIntegration.enableFishIntegration = true;
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";
"ctrl+shift+c" = "copy_to_clipboard";
"ctrl+shift+v" = "paste_from_clipboard";
};
settings = {
background_opacity = lib.mkForce "0.95";
dynamic_background_opacity = true;
enabled_layouts = "tall:bias=50;full_size=1;mirrored=false,stack";
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 ''}";
};
};
lazygit = {
enable = true;
};
lsd = {
enable = true;
enableAliases = true;
};
neomutt = {
enable = true;
vimKeys = true;
sidebar.enable = true;
};
newsboat = {
enable = true;
extraConfig = ''
color background color234 default # Dark Everforest background
color listnormal color249 default # Neutral gray for readability
color listnormal_unread color142 default # Highlighted for unread items
color listfocus color234 color142 # Inverse for focused items
color listfocus_unread color234 color142 bold
color info color108 color234 # Subtle info text
color article color249 default # Neutral for article content
# Highlights
highlight article "^(Feed|Link):.*$" color109 default bold
highlight article "^(Title|Date|Author):.*$" color109 default bold
highlight article "https?://[^ ]+" color214 default underline # Bright orange-yellow for links
highlight article "\\[[0-9]+\\]" color142 default bold # Matches unread highlight
highlight article "\\[image\\ [0-9]+\\]" color142 default bold # Matches unread highlight
highlight feedlist "^.*$" color142 color234 bold
'';
};
niri = {
enable = false;
};
nixvim = {
enable = true;
defaultEditor = true;
vimAlias = true;
viAlias = true;
vimdiffAlias = true;
clipboard.providers.wl-copy.enable = 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>";
}
{
key = "<leader>?";
action = "<cmd>WhichKey<cr>";
}
];
opts = {
conceallevel = 1;
expandtab = true;
ignorecase = true;
number = true;
relativenumber = true;
ruler = true;
shiftwidth = 2;
smartcase = true;
tabstop = 2;
};
plugins = {
comment.enable = true;
cmp = {
enable = true;
autoEnableSources = true;
settings.sources = [
{ name = "cmdline"; }
{ name = "emoji"; }
{ name = "fish"; }
{ name = "nvim-lsp"; }
];
};
lualine.enable = true;
fidget.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;
};
};
neogit.enable = true;
neo-tree = {
enable = true;
enableGitStatus = true;
gitStatusAsync = true;
enableModifiedMarkers = true;
closeIfLastWindow = true;
};
nix.enable = true;
noice.enable = false;
notify.enable = false;
nvim-autopairs.enable = true;
nvim-colorizer.enable = true;
obsidian = {
enable = true;
settings = {
dir = "~/muhhmory";
daily_notes = {
folder = "Journal/Daily Pages";
template = "Daily Page.md";
};
templates = {
subdir = "Templates";
};
};
};
oil.enable = true;
render-markdown.enable = true;
vim-surround.enable = true;
which-key.enable = true;
telescope = {
enable = true;
extensions = {
fzf-native.enable = true;
};
};
transparent.enable = true;
toggleterm.enable = true;
treesitter = {
enable = true;
settings = {
indent.enable = true;
};
};
web-devicons.enable = true;
zen-mode.enable = true;
};
extraPlugins = with pkgs.vimPlugins; [
];
};
nnn = {
enable = true;
extraPackages = with pkgs; [
ffmpegthumbnailer
mediainfo
sxiv
];
package = pkgs.nnn.override ({
withNerdIcons = true;
});
plugins = {
mappings = {
c = "fzcd";
f = "finder";
v = "imgview";
};
src = (pkgs.fetchFromGitHub {
owner = "jarun";
repo = "nnn";
rev = "v4.9";
sha256 = "sha256-Hpc8YaJeAzJoEi7aJ6DntH2VLkoR6ToP6tPYn3llR7k=";
}) + "/plugins";
};
};
mbsync = {
enable = true;
};
obs-studio = {
enable = true;
plugins = [
pkgs.obs-studio-plugins.wlrobs
];
};
ripgrep.enable = true;
starship = {
enable = true;
enableFishIntegration = true;
};
swaylock.enable = true;
waybar = {
enable = true;
systemd.enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 24;
spacing = 3;
output = [ "DP-1" ];
modules-left = [
"sway/workspaces"
"sway/mode"
"sway/scratchpad"
"sway/window"
"custom/media"
];
modules-center = [
"clock"
"idle_inhibitor"
];
modules-right = [
"pulseaudio"
"backlight"
"network"
"tray"
"custom/notification"
"custom/power"
];
"sway/scratchpad" = {
format = "{icon} {count}";
show-empty = false;
format-icons = ["" "<U+F2D2>"];
tooltip = true;
tooltip-format = "{app}: {title}";
};
"backlight" = {
device = "ddcci6";
format = "{percent}% {icon}";
format-icons = [ "<U+F5D9>" "<U+F5DA>" "<U+F5DB>" "<U+F5DC>" "<U+F5DD>" "<U+F5DE>" "<U+F5DF>"];
};
"clock" = {
format = "{:%d. %B | %H:%M}";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
format-alt = "{: KW %OV, %A, %d. %B %Y | %H:%M}";
calendar = {
mode = "year";
mode-mon-col = 3;
weeks-pos = "right";
on-scroll = 1;
on-click-right = "mode";
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
};
};
"actions" = {
on-click-right = "mode";
on-click-forward = "tz_up";
on-click-backward = "tz_down";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
};
"tray" = {
icon-size = 16;
spacing = 6;
};
};
};
};
yazi = {
enable = true;
enableFishIntegration = 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;
events = [
{ event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock -fF"; }
];
timeouts = [
{
timeout = 300;
command = "${pkgs.swaylock}/bin/swaylock -fF";
}
{
timeout = 330;
command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'";
resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * dpms on'";
}
];
};
swaync = {
enable = true;
};
swayosd = {
enable = true;
display = "DP-1";
};
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 = {
atuin_key = {};
"mail/privat/address" = {};
"mail/privat/username" = {};
"mail/privat/password" = {};
"mail/icloud/address" = {};
"mail/icloud/username" = {};
"mail/icloud/password" = {};
};
};
stylix = {
enable = true;
image = /home/muhh/Sync/Backgrounds/wald.jpg;
polarity = "dark";
# base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
# base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-city-terminal-dark.yaml";
base16Scheme = "${pkgs.base16-schemes}/share/themes/everforest.yaml";
fonts = {
monospace = {
package = (pkgs.nerdfonts.override { fonts = [ "Iosevka" ]; });
name = "Iosevka Nerd Font";
};
sizes = {
terminal = 14;
};
};
};
wayland.windowManager = {
sway = {
enable = true;
extraConfig = ''
smart_gaps inverse_outer
'';
config = {
bars = [];
window = {
commands = [
{
command = "floating enable, sticky enable, resize set 20 ppt 40 ppt, border pixel 10";
criteria = {
app_id = "^launcher";
};
}
];
};
gaps = {
inner = 30;
vertical = 50;
horizontal = 400;
# smartGaps = true;
smartBorders = "on";
};
input = {
"type:keyboard" = {
xkb_layout = "eu";
xkb_options = "compose:rwin";
};
"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}+o" = "for_window [class=obsidian] scratchpad show";
};
menu = "kitty --app-id launcher -e sway-launcher-desktop";
modifier = "Mod4";
output = {
DP-1 = {
resolution = "3840x2160@30Hz";
position = "1280 0";
# background = "/home/muhh/Sync/Backgrounds/wald.jpg fill";
scale = "1.5";
};
HDMI-A-1 = {
resolution = "1920x1080@60.000Hz";
transform = "180";
position = "0 0";
scale = "1.5";
# background = "/home/muhh/Sync/Backgrounds/pfuetze.jpg fill";
};
};
seat = {
"*" = {
hide_cursor = "5000";
};
};
terminal = "kitty";
window = {
titlebar = false;
};
workspaceOutputAssign =
map (x: {
workspace = x;
output = "DP-1";
}) ["1" "2" "3" "4" "5" "6" "7"]
++ map (x: {
workspace = x;
output = "HDMI-A-1";
}) ["8" "9" "10"];
};
wrapperFeatures.gtk = true;
};
};
xdg = {
enable = true;
mimeApps.enable = true;
};
# leave things below alone.
home.stateVersion = "23.05";
programs.home-manager.enable = true;
}