nix-config/home.nix

704 lines
18 KiB
Nix
Raw Normal View History

2024-01-30 17:29:47 +01:00
{ config, pkgs, lib, ... }:
{
2024-06-05 15:31:00 +02:00
home = {
username = "muhh";
homeDirectory = "/home/muhh";
activation.setupEtc = config.lib.dag.entryAfter [ "writeBoundary" ] ''
/run/current-system/sw/bin/systemctl start --user sops-nix
'';
2024-06-05 15:31:00 +02:00
packages = with pkgs; [
2024-12-06 18:05:54 +01:00
_1password-cli
2024-06-05 15:31:00 +02:00
_1password-gui
atkinson-hyperlegible
2024-07-05 12:17:07 +02:00
alacritty
2024-08-13 12:48:34 +02:00
blueman
2024-06-05 15:31:00 +02:00
brightnessctl
2024-12-05 16:53:48 +01:00
chafa
2024-06-05 15:31:00 +02:00
curl
2024-07-17 17:21:16 +02:00
darktable
2024-06-19 16:54:29 +02:00
ddcutil
2024-12-05 16:53:48 +01:00
ddev
2024-11-28 18:16:12 +01:00
devenv
2024-06-05 15:31:00 +02:00
distrobox
2024-07-01 17:38:26 +02:00
dog
2024-08-13 12:50:40 +02:00
downonspot
2024-12-06 18:54:13 +01:00
fastfetch
2024-06-05 15:31:00 +02:00
fd
ffmpegthumbnailer
2024-07-05 12:17:07 +02:00
fuzzel
2024-06-05 15:31:00 +02:00
git
2024-09-23 09:17:57 +02:00
heroku
2024-06-05 15:31:00 +02:00
htop
httpie
2024-06-12 22:39:51 +02:00
just
2024-08-13 12:50:40 +02:00
libreoffice
2024-06-05 15:31:00 +02:00
neovide
2024-12-06 18:05:54 +01:00
nerd-fonts.iosevka
2024-06-05 15:31:00 +02:00
maid
mediainfo
mpv
morgen
obsidian
2024-10-01 15:59:34 +02:00
offpunk
2024-08-13 12:48:34 +02:00
pamixer
2024-06-05 15:31:00 +02:00
pavucontrol
powertop
qutebrowser
rclone
2024-08-13 12:50:40 +02:00
rockbox-utility
2024-07-01 17:37:23 +02:00
signal-desktop
2024-06-05 15:31:00 +02:00
solargraph
sops
2024-08-13 12:50:40 +02:00
spot
2024-06-05 15:31:00 +02:00
sxiv
steam-run
tmux
unzip
via
wget
2024-07-01 17:38:26 +02:00
whois
2024-06-05 15:31:00 +02:00
wl-clipboard
2024-06-16 18:06:04 +02:00
wl-mirror
sway-launcher-desktop
2024-06-19 15:27:15 +02:00
swaynotificationcenter
swayosd
2024-08-13 12:50:40 +02:00
vivaldi
2024-06-05 15:31:00 +02:00
xdg-utils
zellij
zulip
];
2024-01-30 17:29:47 +01:00
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
2024-06-05 15:31:00 +02:00
file = {
2024-01-30 17:29:47 +01:00
# # 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
# '';
2024-06-05 15:31:00 +02:00
};
2024-01-30 17:29:47 +01:00
# 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.
2024-06-05 15:31:00 +02:00
sessionVariables = {
EDITOR = "nvim";
};
2024-01-30 17:29:47 +01:00
};
2024-02-29 10:22:10 +01:00
accounts = {
email = {
accounts = {
privat = {
2024-02-29 10:22:10 +01:00
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)'';
2024-02-29 10:22:10 +01:00
imap.host = "imap.mailbox.org";
# neomutt.enable = true;
mbsync = {
enable = true;
create = "both";
};
2024-02-29 10:22:10 +01:00
};
};
};
};
2024-01-30 17:29:47 +01:00
programs = {
atuin = {
enable = true;
enableFishIntegration = true;
flags = [
"--disable-up-arrow"
];
2024-05-22 10:14:20 +02:00
settings = {
auto_sync = true;
2024-11-28 18:16:12 +01:00
history_filter = [
"^..$"
"^cd "
"^ls "
"^mv "
"^rm "
];
2024-05-22 10:14:20 +02:00
key_path = config.sops.secrets.atuin_key.path;
};
2024-01-30 17:29:47 +01:00
};
bat = {
enable = true;
};
btop = {
enable = true;
};
2024-05-17 16:37:59 +02:00
direnv = {
enable = true;
nix-direnv.enable = true;
};
2024-05-20 17:38:01 +02:00
firefox = {
enable = true;
};
2024-01-30 17:29:47 +01:00
fish = {
enable = true;
loginShellInit = ''
2024-12-10 17:38:17 +01:00
# if test (tty) = /dev/tty1
# exec sway
# end
2024-01-30 17:29:47 +01:00
'';
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";
2024-09-12 15:49:28 +02:00
pull.rebase = true;
2024-01-30 17:29:47 +01:00
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;
2024-03-06 12:10:11 +01:00
keys = [
"id_ed25519"
2024-06-05 15:28:46 +02:00
"id_rsa"
2024-03-06 12:10:11 +01:00
];
2024-01-30 17:29:47 +01:00
};
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";
2024-11-28 18:16:12 +01:00
"ctrl+shift+c" = "copy_to_clipboard";
"ctrl+shift+v" = "paste_from_clipboard";
2024-01-30 17:29:47 +01:00
};
settings = {
2024-06-05 15:28:46 +02:00
background_opacity = lib.mkForce "0.95";
2024-01-30 17:29:47 +01:00
dynamic_background_opacity = true;
2024-10-14 17:00:54 +02:00
enabled_layouts = "tall:bias=50;full_size=1;mirrored=false,stack";
2024-01-30 17:29:47 +01:00
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";
2024-01-30 17:29:47 +01:00
tab_title_template = "{title}{' :{}:'.format(num_windows) if num_windows > 1 else ''}";
};
};
lazygit = {
enable = true;
};
2024-01-30 17:29:47 +01:00
lsd = {
enable = true;
enableAliases = true;
};
2024-02-29 10:22:10 +01:00
neomutt = {
enable = true;
vimKeys = true;
sidebar.enable = true;
};
2024-11-28 18:16:12 +01:00
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
'';
};
2024-07-05 12:17:07 +02:00
niri = {
2024-12-10 17:38:17 +01:00
enable = true;
# settings = {
# environment = {
# "NIXOS_OZONE_WL" = "1";
# "QT_QPA_PLATFORM" = "wayland";
# };
# };
2024-07-05 12:17:07 +02:00
};
2024-01-30 17:29:47 +01:00
nixvim = {
enable = true;
2024-06-19 15:27:01 +02:00
defaultEditor = true;
2024-01-30 17:29:47 +01:00
vimAlias = true;
viAlias = true;
2024-06-19 15:27:01 +02:00
vimdiffAlias = true;
2024-01-30 17:29:47 +01:00
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>";
}
2024-10-02 13:58:09 +02:00
{
key = "<leader>?";
action = "<cmd>WhichKey<cr>";
}
2024-01-30 17:29:47 +01:00
];
2024-05-17 12:26:27 +02:00
opts = {
conceallevel = 1;
2024-01-30 17:29:47 +01:00
expandtab = true;
ignorecase = true;
number = true;
relativenumber = true;
ruler = true;
2024-01-30 17:29:47 +01:00
shiftwidth = 2;
smartcase = true;
tabstop = 2;
};
plugins = {
2024-12-10 17:38:32 +01:00
colorizer.enable = true;
comment.enable = true;
2024-10-02 16:42:47 +02:00
cmp = {
enable = true;
autoEnableSources = true;
settings.sources = [
{ name = "cmdline"; }
{ name = "emoji"; }
{ name = "fish"; }
{ name = "nvim-lsp"; }
];
};
lualine.enable = true;
2024-10-02 13:58:09 +02:00
fidget.enable = true;
fugitive.enable = true;
2024-01-30 17:29:47 +01:00
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;
2024-01-30 17:29:47 +01:00
};
};
2024-10-02 13:58:09 +02:00
neogit.enable = true;
2024-01-30 17:29:47 +01:00
neo-tree = {
enable = true;
enableGitStatus = true;
gitStatusAsync = true;
enableModifiedMarkers = true;
closeIfLastWindow = true;
};
nix.enable = true;
2024-10-02 13:58:09 +02:00
noice.enable = false;
2024-10-02 16:43:15 +02:00
notify.enable = false;
nvim-autopairs.enable = true;
2024-01-30 17:29:47 +01:00
obsidian = {
enable = true;
settings = {
2024-11-28 18:16:12 +01:00
dir = "~/muhhmory";
daily_notes = {
folder = "Journal/Daily Pages";
template = "Daily Page.md";
};
templates = {
subdir = "Templates";
};
};
2024-01-30 17:29:47 +01:00
};
oil.enable = true;
2024-10-02 13:58:09 +02:00
render-markdown.enable = true;
2024-09-23 09:18:05 +02:00
vim-surround.enable = true;
2024-10-02 13:58:09 +02:00
which-key.enable = true;
2024-01-30 17:29:47 +01:00
telescope = {
enable = true;
extensions = {
fzf-native.enable = true;
};
};
transparent.enable = true;
toggleterm.enable = true;
treesitter = {
enable = true;
2024-08-13 12:50:48 +02:00
settings = {
indent.enable = true;
};
};
2024-09-23 09:18:05 +02:00
web-devicons.enable = true;
2024-10-02 13:58:09 +02:00
zen-mode.enable = true;
2024-01-30 17:29:47 +01:00
};
extraPlugins = with pkgs.vimPlugins; [
];
};
2024-05-22 10:14:35 +02:00
nnn = {
enable = true;
2024-06-05 15:31:16 +02:00
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";
};
2024-05-22 10:14:35 +02:00
};
mbsync = {
enable = true;
};
2024-06-19 14:18:18 +02:00
obs-studio = {
enable = true;
plugins = [
pkgs.obs-studio-plugins.wlrobs
];
};
2024-01-30 17:29:47 +01:00
ripgrep.enable = true;
starship = {
enable = true;
enableFishIntegration = true;
};
swaylock.enable = true;
2024-06-05 15:31:16 +02:00
waybar = {
enable = true;
systemd.enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
2024-06-19 15:27:15 +02:00
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"
];
2024-07-17 17:21:23 +02:00
"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;
};
2024-01-30 17:29:47 +01:00
zoxide = {
enable = true;
};
};
services = {
mbsync = {
enable = true;
preExec = "";
postExec = "";
};
2024-12-06 18:05:54 +01:00
gnome-keyring.enable = true;
2024-01-30 17:29:47 +01:00
playerctld.enable = true;
swayidle = {
enable = true;
2024-05-20 17:37:28 +02:00
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'";
}
];
2024-01-30 17:29:47 +01:00
};
2024-06-19 15:27:15 +02:00
swaync = {
enable = true;
};
swayosd = {
enable = true;
2024-06-19 15:27:15 +02:00
display = "DP-1";
};
syncthing = {
enable = true;
# dataDir = "/home/muhh/Sync";
# configDir = "/home/muhh/.config/syncthing";
};
2024-01-30 17:29:47 +01:00
};
sops = {
age.keyFile = "${config.xdg.configHome}/sops/age/keys.txt";
defaultSopsFile = ./secrets/secrets.yaml;
secrets = {
2024-05-22 10:14:20 +02:00
atuin_key = {};
"mail/privat/address" = {};
"mail/privat/username" = {};
"mail/privat/password" = {};
"mail/icloud/address" = {};
"mail/icloud/username" = {};
"mail/icloud/password" = {};
};
};
2024-06-05 15:28:46 +02:00
stylix = {
2024-06-19 15:26:43 +02:00
enable = true;
2024-06-05 15:28:46 +02:00
image = /home/muhh/Sync/Backgrounds/wald.jpg;
polarity = "dark";
2024-06-19 15:26:43 +02:00
# base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
2024-07-05 16:07:43 +02:00
# base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-city-terminal-dark.yaml";
base16Scheme = "${pkgs.base16-schemes}/share/themes/everforest.yaml";
2024-06-19 15:26:43 +02:00
fonts = {
monospace = {
2024-12-06 18:05:54 +01:00
package = pkgs.nerd-fonts.iosevka;
2024-06-19 15:26:43 +02:00
name = "Iosevka Nerd Font";
};
sizes = {
terminal = 14;
};
};
2024-06-05 15:28:46 +02:00
};
2024-01-30 17:29:47 +01:00
wayland.windowManager = {
sway = {
enable = true;
2024-06-05 15:29:30 +02:00
extraConfig = ''
smart_gaps inverse_outer
'';
2024-01-30 17:29:47 +01:00
config = {
bars = [];
2024-06-16 18:06:04 +02:00
window = {
commands = [
{
command = "floating enable, sticky enable, resize set 20 ppt 40 ppt, border pixel 10";
criteria = {
app_id = "^launcher";
};
}
];
};
2024-01-30 17:29:47 +01:00
gaps = {
inner = 30;
vertical = 50;
horizontal = 400;
2024-06-05 15:29:30 +02:00
# smartGaps = true;
2024-01-30 17:29:47 +01:00
smartBorders = "on";
};
input = {
"type:keyboard" = {
2024-06-05 15:29:30 +02:00
xkb_layout = "eu";
xkb_options = "compose:rwin";
2024-01-30 17:29:47 +01:00
};
"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";
2024-08-13 12:51:06 +02:00
"${modifier}+o" = "for_window [class=obsidian] scratchpad show";
2024-01-30 17:29:47 +01:00
};
2024-06-16 18:06:04 +02:00
menu = "kitty --app-id launcher -e sway-launcher-desktop";
2024-01-30 17:29:47 +01:00
modifier = "Mod4";
2024-05-20 17:37:28 +02:00
output = {
DP-1 = {
resolution = "3840x2160@30Hz";
2024-06-05 15:29:30 +02:00
position = "1280 0";
2024-05-20 17:37:28 +02:00
# background = "/home/muhh/Sync/Backgrounds/wald.jpg fill";
scale = "1.5";
2024-05-20 17:37:28 +02:00
};
HDMI-A-1 = {
resolution = "1920x1080@60.000Hz";
transform = "180";
position = "0 0";
2024-06-05 15:29:30 +02:00
scale = "1.5";
2024-05-20 17:37:28 +02:00
# background = "/home/muhh/Sync/Backgrounds/pfuetze.jpg fill";
};
};
2024-01-30 17:29:47 +01:00
seat = {
"*" = {
hide_cursor = "5000";
};
};
terminal = "kitty";
window = {
titlebar = false;
};
2024-06-05 15:29:30 +02:00
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"];
2024-01-30 17:29:47 +01:00
};
2024-06-05 15:29:30 +02:00
wrapperFeatures.gtk = true;
2024-01-30 17:29:47 +01:00
};
};
2024-06-05 15:29:30 +02:00
xdg = {
enable = true;
mimeApps.enable = true;
};
2024-01-30 17:29:47 +01:00
# leave things below alone.
home.stateVersion = "23.05";
programs.home-manager.enable = true;
}