nix-config/home.nix

576 lines
14 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-01-30 17:29:47 +01:00
# # 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}!"
# '')
2024-06-05 15:31:00 +02:00
_1password
_1password-gui
atkinson-hyperlegible
brightnessctl
curl
distrobox
dig
2024-06-05 15:31:00 +02:00
fd
ffmpegthumbnailer
git
htop
httpie
neovide
(nerdfonts.override { fonts = [ "Iosevka" ]; })
maid
mediainfo
mpv
morgen
obsidian
pavucontrol
powertop
qutebrowser
rclone
solargraph
sops
sxiv
steam-run
tmux
unzip
via
wget
wl-clipboard
xdg-utils
zellij
zulip
zulip-term
];
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;
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 = ''
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;
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;
font = {
2024-06-05 15:28:46 +02:00
name = lib.mkForce "Iosevka Nerd Font";
size = lib.mkForce 14;
2024-01-30 17:29:47 +01:00
};
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 = {
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;
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";
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-01-30 17:29:47 +01:00
nixvim = {
enable = true;
vimAlias = true;
viAlias = 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>";
}
];
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 = {
comment.enable = true;
cmp-cmdline.enable = true;
cmp-fish.enable = true;
cmp-nvim-lsp.enable = true;
lualine.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
};
};
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;
2024-01-30 17:29:47 +01:00
obsidian = {
enable = true;
settings = {
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-01-30 17:29:47 +01:00
surround.enable = true;
telescope = {
enable = true;
extensions = {
2024-05-17 12:26:27 +02:00
# file_browser.enable = true;
2024-01-30 17:29:47 +01:00
fzf-native.enable = true;
};
};
transparent.enable = true;
toggleterm.enable = true;
treesitter = {
enable = true;
indent = 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-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";
height = 36;
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-01-30 17:29:47 +01:00
zoxide = {
enable = true;
};
};
services = {
mbsync = {
enable = true;
preExec = "";
postExec = "";
};
2024-01-30 17:29:47 +01:00
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;
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
};
swayosd = {
enable = true;
};
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 = {
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";
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 = {
gaps = {
2024-05-20 17:37:28 +02:00
inner = 50;
vertical = 100;
horizontal = 600;
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";
};
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";
2024-06-05 15:29:30 +02:00
scale = "1.25";
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;
}