nix-config/users/krop/default.nix

373 lines
9 KiB
Nix
Raw Normal View History

2024-09-22 21:36:02 +02:00
{ config, pkgs, ... }:
{
home.username = "krop";
home.homeDirectory = "/home/krop";
2024-10-29 22:10:28 +01:00
home.stateVersion = "24.05";
2024-09-22 21:36:02 +02:00
home.packages = with pkgs; [
gnomeExtensions.grand-theft-focus
2024-09-25 22:30:23 +02:00
gnomeExtensions.vitals
spotify
2024-10-18 15:46:07 +02:00
moonlight-qt
2024-10-21 10:02:47 +02:00
alacritty
alacritty-theme
nixd
nil
fzf
zoxide
jetbrains-mono
mattermost-desktop
gh
gparted
prismlauncher # REMOVE AND MOVE TO games module after refactoring
joplin-desktop
albert
2024-10-22 10:48:55 +02:00
ghostscript
2024-10-21 10:02:47 +02:00
(octaveFull.withPackages (
ps: with ps; [
octavePackages.signal
]
))
wireshark
2024-10-23 08:35:40 +02:00
iperf
2024-10-30 22:08:12 +01:00
gopls
2024-09-22 21:36:02 +02:00
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# hello
# # 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?
# (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:
# (writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
];
home.pointerCursor = {
name = "Adwaita";
package = pkgs.adwaita-icon-theme;
gtk.enable = true;
x11.enable = true;
size = 24;
};
2024-09-22 21:36:02 +02:00
dconf = {
2024-09-23 19:55:03 +02:00
settings = {
"org/gnome/shell" = {
disable-user-extensions = false;
enabled-extensions = with pkgs.gnomeExtensions; [
grand-theft-focus.extensionUuid
2024-09-25 22:30:23 +02:00
vitals.extensionUuid
2024-09-23 19:55:03 +02:00
];
2024-09-23 20:23:58 +02:00
favorite-apps = [
"firefox.desktop"
"Alacritty.desktop"
"thunderbird.desktop"
"org.gnome.Nautilus.desktop"
];
2024-09-23 19:55:03 +02:00
};
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
2024-11-05 10:29:16 +01:00
accent-color = "red";
2024-09-25 22:38:49 +02:00
show-battery-percentage = true;
2024-10-25 12:15:44 +02:00
gtk-enable-primary-paste = false;
2024-09-23 19:55:03 +02:00
};
2024-09-23 20:23:58 +02:00
"org/gnome/mutter" = {
dynamic-workspaces = true;
edge-tiling = true;
workspaces-only-on-primary = true;
};
2024-09-23 19:56:07 +02:00
"org/gnome/desktop/peripherals/touchpad" = {
2024-09-23 19:55:03 +02:00
natural-scroll = false;
2024-09-23 20:23:58 +02:00
click-method = "areas";
};
"org/gnome/desktop/wm/preferences" = {
button-layout = "appmenu:minimize,maximize,close";
resize-with-right-button = true;
};
2024-09-27 10:38:19 +02:00
"org/gnome/desktop/sound" = {
event-sounds = false;
};
2024-09-23 20:23:58 +02:00
"org/gnome/desktop/search-providers" = {
disabled = [
"org.gnome.Contacts.desktop"
"org.gnome.Calculator.desktop"
"org.gnome.Calendar.desktop"
"org.gnome.Characters.desktop"
"org.gnome.clocks.desktop"
"org.gnome.Software.desktop"
];
2024-09-23 19:55:03 +02:00
};
2024-09-25 22:38:49 +02:00
"org/gnome/shell/extensions/vitals" = {
position-in-panel = 0;
show-battery = true;
icon-style = 1;
hot-sensors = [
"__temperature_max__"
"_memory_available_"
"_storage_free_"
];
};
2024-09-26 16:28:00 +02:00
"org/gnome/desktop/background" =
let
bgPath = "file://${./nyan_cat.jpg}";
in
{
picture-options = "zoom";
picture-uri = bgPath;
picture-uri-dark = bgPath;
};
2024-09-22 21:36:02 +02:00
};
};
gtk = {
enable = true;
2024-11-04 14:42:43 +01:00
theme = {
name = "Adwaita-dark";
package = pkgs.gnome-themes-extra;
};
2024-09-22 21:36:02 +02:00
gtk3.extraConfig = {
2024-11-04 14:42:43 +01:00
gtk-application-prefer-dark-theme = 1;
2024-09-22 21:36:02 +02:00
};
gtk4.extraConfig = {
2024-11-04 14:42:43 +01:00
gtk-application-prefer-dark-theme = 1;
2024-09-22 21:36:02 +02:00
};
};
2024-10-21 19:14:43 +02:00
qt = {
enable = true;
2024-11-04 14:42:43 +01:00
platformTheme.name = "Adwaita-dark";
style = {
name = "Adwaita-dark";
package = pkgs.adwaita-qt;
};
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
configPackages = with pkgs; [ xdg-desktop-portal-gtk ];
2024-10-21 19:14:43 +02:00
};
2024-09-22 21:36:02 +02:00
2024-10-25 12:15:44 +02:00
programs.fzf = {
enable = true;
};
2024-10-24 21:46:35 +02:00
programs.go = {
enable = true;
goPath = "Repositories/go";
};
2024-09-24 19:44:48 +02:00
programs.vscode = {
enable = true;
package = pkgs.vscodium;
extensions = with pkgs.vscode-extensions; [
2024-09-25 20:49:23 +02:00
jnoortheen.nix-ide
tamasfe.even-better-toml
2024-10-01 22:53:31 +02:00
vscodevim.vim
2024-10-04 09:33:40 +02:00
ms-azuretools.vscode-docker
ms-kubernetes-tools.vscode-kubernetes-tools
2024-10-07 08:23:44 +02:00
redhat.vscode-yaml
2024-10-21 19:14:29 +02:00
ms-python.python
ms-python.debugpy
ms-python.vscode-pylance
2024-10-30 22:06:05 +01:00
golang.go
2024-09-24 19:44:48 +02:00
];
2024-10-01 23:09:25 +02:00
mutableExtensionsDir = false;
2024-09-24 19:44:48 +02:00
};
2024-09-25 20:49:23 +02:00
programs.zoxide = {
enable = true;
options = [
"--cmd cd"
];
};
2024-10-23 08:35:40 +02:00
programs.micro = {
enable = true;
settings = {
colorscheme = "atom-dark";
wordwrap = true;
};
};
2024-09-27 08:57:00 +02:00
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
2024-09-27 09:10:23 +02:00
stdlib = ''
: ''${XDG_CACHE_HOME:=$HOME/.cache}
declare -A direnv_layout_dirs
direnv_layout_dir() {
echo "''${direnv_layout_dirs[$PWD]:=$(
echo -n "$XDG_CACHE_HOME"/direnv/layouts/
echo -n "$PWD" | sha1sum | cut -d ' ' -f 1
)}"
}
'';
2024-09-27 08:57:00 +02:00
};
2024-09-25 20:49:23 +02:00
programs.zsh = {
enable = true;
2024-10-04 08:49:42 +02:00
autocd = true;
2024-10-03 14:26:19 +02:00
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
2024-09-25 20:49:23 +02:00
initExtra = ''
bindkey "^[[1;3D" backward-word
bindkey "^[[1;5D" backward-word
bindkey "^[[1;3C" forward-word
bindkey "^[[1;5C" forward-word
bindkey "^[[3~" delete-char
2024-09-25 21:27:27 +02:00
autoload -Uz vcs_info
setopt auto_menu
setopt complete_in_word
setopt always_to_end
# zstyle command format
# zstyle :<namespace>:<function>:<completer>:<command>:<argument>:<tag> <style> <value>
zstyle ':completion:*' menu select
zstyle ':completion:*' special-dirs true
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path "$ZSH/.zsh/.zcompcache"
precmd() {
vcs_info
is_toolbx_container
}
setopt PROMPT_SUBST
zstyle ':vcs_info:git:*' formats '[%b] '
is_toolbx_container() {
if [[ -f /run/.containerenv ]]; then
CONTAINER_NAME=$(grep -oP 'name="\K[^"]+' /run/.containerenv)
TOOLBX_INDICATOR="[%F{magenta}''${CONTAINER_NAME}%f] "
else
TOOLBX_INDICATOR=""
fi
}
PROMPT='%2~ ''${TOOLBX_INDICATOR}''${vcs_info_msg_0_}»%b '
2024-09-25 20:49:23 +02:00
'';
2024-09-25 21:27:27 +02:00
dotDir = ".zsh";
completionInit = "autoload -U compinit; compinit -d $ZSH/.zcompdump";
history.path = "$ZDOTDIR/.zsh_history";
shellAliases = {
2024-09-25 22:24:14 +02:00
lg = "lazygit";
cls = "clear";
open = "xdg-open";
fire = "firefox";
la = "ls -al --color=auto";
gs = "git status";
ga = "git add";
gaa = "git add --all";
cg-run = "cargo run";
cg-build = "cargo build";
cg-test = "cargo test";
dc = "docker compose";
dc-build = "dc build";
dc-run = "dc run --rm";
dc-runr = "dc-run -u root";
dc-up = "dc up";
dc-upd = "dc up -d";
dc-down = "dc down";
dc-ls = "dc ls";
dc-pull = "dc pull";
ds-env = "env $(cat .env | grep \"^[A-Z]\" | xargs) docker stack";
bw-unlock = "BW_SESSION=$(bw unlock --raw) && export BW_SESSION";
t = "tmux";
pc = "pre-commit";
tb = "toolbox";
};
};
programs.alacritty = {
enable = true;
settings = {
2024-10-24 21:46:35 +02:00
general = {
import = [ "${pkgs.alacritty-theme}/gnome_terminal.toml" ];
};
2024-09-25 22:24:14 +02:00
font = {
size = 16;
};
2024-09-25 21:27:27 +02:00
};
2024-09-25 20:49:23 +02:00
};
2024-09-25 21:39:12 +02:00
programs.tmux = {
enable = true;
mouse = true;
2024-10-23 08:35:40 +02:00
terminal = "tmux-256color";
2024-09-25 21:39:12 +02:00
plugins = with pkgs.tmuxPlugins; [
yank
sensible
];
extraConfig = ''
2024-09-25 22:24:14 +02:00
# Move status bar to top
set -g status-position top
2024-09-25 21:39:12 +02:00
2024-09-25 22:24:14 +02:00
# Indexing from 1 instead of 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
2024-09-25 21:39:12 +02:00
'';
};
2024-09-22 21:36:02 +02:00
programs.git = {
enable = true;
userName = "Jakub Kropáček";
userEmail = "kropikuba@gmail.com";
includes =
let
workcfg = {
user = {
email = "jakub.kropacek@olc.cz";
name = "Jakub Kropáček";
};
};
in
[
{
condition = "gitdir:~/Repositories/OLC/**";
contents = workcfg;
}
{
condition = "gitdir:~/Repositories/OLC-Hexpol/**";
contents = workcfg;
}
];
extraConfig = {
init = {
defaultBranch = "master";
};
push = {
autoSetupRemote = true;
};
status = {
submoduleSummary = true;
};
diff = {
submodule = "log";
};
core = {
autocrlf = "input";
};
};
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}