nixos-config/common/home.nix
2024-11-04 13:51:28 +01:00

389 lines
9 KiB
Nix

{ config, pkgs, ... }:
{
home.username = "ahurac";
home.homeDirectory = "/home/ahurac";
home.stateVersion = "24.05";
home.packages = with pkgs; [
catimg
virt-manager
unzip
jq
nil
pavucontrol
thunderbird
wl-clipboard
swayosd
prismlauncher
noto-fonts
libreoffice
mosh
gnumake
man-pages
man-pages-posix
clang-tools
gdb
gcc
valgrind
nixfmt-classic
cloc
nodejs_22
texliveFull
bash-language-server
shfmt
libnotify
(nerdfonts.override { fonts = [ "Hack" ]; })
];
home.sessionVariables = { EDITOR = "hx"; };
gtk = {
enable = true;
theme = {
package = pkgs.adw-gtk3;
name = "adw-gtk3-dark";
};
iconTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
};
font.name = "Noto Sans";
font.size = 11;
};
xdg.portal = {
enable = true;
config.common.default = [ "gnome" "gtk" ];
extraPortals = [ pkgs.xdg-desktop-portal-gnome ];
};
services.ssh-agent.enable = true;
services.flatpak.packages = [
"im.riot.Riot"
"io.github.spacingbat3.webcord"
"net.cozic.joplin_desktop"
"dev.aunetx.deezer"
"com.jgraph.drawio.desktop"
];
services.flatpak.update.onActivation = true;
services.flatpak.overrides = {
global = {
Context.sockets = [ "wayland" "!x11" "!fallback-x11" ];
Environment = {
XCURSOR_PATH = "/run/host/user-share/icons:/run/host/share/icons";
GTK_THEME = "adw-gtk3-dark";
};
};
};
programs.librewolf = {
enable = true;
package = pkgs.librewolf-bin;
};
programs.kitty.enable = true;
programs.helix = {
enable = true;
package = pkgs.evil-helix;
settings = { editor.soft-wrap.enable = true; };
languages.language = [
{
name = "nix";
auto-format = true;
formatter.command = "nixfmt";
}
{
name = "c";
auto-format = true;
formatter.command = "clang-format";
}
{
name = "bash";
auto-format = true;
formatter.command = "shfmt";
}
];
};
programs.rbw = {
enable = true;
settings = {
email = "hchauvin@mailbox.org";
base_url = "https://vw.ahur.ac";
pinentry = pkgs.pinentry-curses;
};
};
fonts.fontconfig.enable = true;
fonts.fontconfig.defaultFonts = {
sansSerif = [ "Noto Sans" ];
monospace = [ "Hack Nerd Font" ];
emoji = [ "Noto Color Emoji" ];
};
home.pointerCursor = {
name = "Bibata-Modern-Ice";
package = pkgs.bibata-cursors;
size = 24;
gtk.enable = true;
};
programs.git = {
enable = true;
aliases = {
a = "add";
c = "commit";
s = "status";
d = "diff";
ch = "checkout";
r = "restore";
re = "reset";
p = "pull";
pu = "push";
m = "merge";
l = "log";
graph = "log --graph --oneline";
sh = "show";
ds = "diff --staged";
};
userEmail = "ahurac@mailbox.org";
userName = "Ahurac";
extraConfig = {
init.defaultBranch = "main";
push.autoSetupRemote = true;
};
};
programs.zsh = {
enable = true;
shellAliases = {
g = "git";
j = "jobs";
sshm = "ssh -M";
pd = "pushd";
wlc = "wl-copy";
};
plugins = [{
name = "vi-mode";
src = pkgs.zsh-vi-mode;
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
}];
initExtra = ''
mkcdir() {
mkdir -p -- "$@" && cd -- "$1"
}
getpwd() {
rbw get "$@" | wl-copy
}
'';
};
programs.swaylock = {
enable = true;
settings = {
color = "202020";
font-size = 24;
font = "Noto Sans";
indicator-radius = 100;
line-uses-ring = true;
separator-color = "00000000";
};
};
programs.anyrun = {
enable = true;
package = pkgs.anyrun;
config = {
plugins = [ "libapplications.so" ];
x.fraction = 0.5;
y.absolute = 0;
width.absolute = 800;
height.absolute = 0;
hideIcons = false;
ignoreExclusiveZones = false;
layer = "overlay";
hidePluginInfo = false;
closeOnClick = false;
showResultsImmediately = false;
maxEntries = null;
};
extraCss = ''
#window {
background-color: rgba(0, 0, 0, 0);
}
box#main {
border-radius: 10px;
background-color: @theme_bg_color;
margin-top: 20px;
}
list#main {
background-color: rgba(0, 0, 0, 0);
border-radius: 10px;
}
list#plugin {
background-color: rgba(0, 0, 0, 0);
}
label#match-desc {
font-size: 10px;
}
label#plugin {
font-size: 14px;
}
'';
};
programs.alacritty = {
enable = true;
settings = {
window = {
dimensions = {
columns = 0;
lines = 0;
};
};
colors.bright = {
blue = "0xb399ff";
cyan = "0x99e6ff";
green = "0x89f5a4";
magenta = "0xe699ff";
red = "0xff809f";
white = "0xffffff";
yellow = "0xffffb3";
};
colors.normal = {
black = "0x000000";
blue = "0x794dff";
cyan = "0x33ccff";
green = "0x13ec49";
magenta = "0xcc33ff";
red = "0xff0040";
white = "0xffffff";
yellow = "0xffff4d";
};
colors.primary = {
background = "0x000000";
foreground = "0xffffff";
};
};
};
services.mako = {
enable = true;
backgroundColor = "#202020e0";
borderColor = "#ffffff80";
borderRadius = 10;
borderSize = 1;
defaultTimeout = 4000;
font = "Noto Sans";
};
systemd.user.services.polkit-gnome-authentication-agent-1 = {
Unit = {
Description = "polkit-gnome-authentication-agent-1";
Wants = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart =
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
programs.niri = {
settings = {
input = {
keyboard = {
xkb.options = "compose:rctrl";
repeat-delay = 300;
repeat-rate = 100;
};
mouse.accel-profile = "flat";
warp-mouse-to-focus = true;
focus-follows-mouse.enable = true;
};
layout = {
gaps = 10;
default-column-width.proportion = 0.5;
preset-window-heights = [{ proportion = 1.0 / 2.0; }];
focus-ring.enable = false;
border = {
enable = true;
width = 2;
inactive.color = "#80808080";
};
};
workspaces = {
w1.name = "admin";
w2.name = "everything";
w3.name = "apps";
};
hotkey-overlay.skip-at-startup = true;
window-rules = [
{
matches =
[{ app-id = "^(im\\.riot\\.Riot|WebCord|@joplin/app-desktop)$"; }];
open-on-workspace = "apps";
}
{
geometry-corner-radius = {
top-left = 10.0;
top-right = 10.0;
bottom-right = 10.0;
bottom-left = 10.0;
};
clip-to-geometry = true;
}
];
prefer-no-csd = true;
screenshot-path = "~/screenshots/%Y%m%d%H%m%N.png";
binds = with config.lib.niri.actions; {
"Mod+Space".action = spawn "alacritty";
"Mod+Shift+Space".action = spawn "alacritty -e sudo -i";
"Mod+F1".action = spawn "anyrun";
"Mod+L".action = spawn "swaylock";
"Mod+Shift+Q".action = close-window;
"Mod+A".action = focus-column-left;
"Mod+Z".action = focus-window-or-workspace-up;
"Mod+S".action = focus-window-or-workspace-down;
"Mod+D".action = focus-column-right;
"Mod+Shift+A".action = move-column-left;
"Mod+Shift+Z".action = move-window-up-or-to-workspace-up;
"Mod+Shift+S".action = move-window-down-or-to-workspace-down;
"Mod+Shift+D".action = move-column-right;
"Mod+Page_Up".action = focus-workspace-up;
"Mod+Page_Down".action = focus-workspace-down;
"Mod+WheelScrollDown".action = focus-column-right;
"Mod+WheelScrollUp".action = focus-column-left;
"Mod+Shift+WheelScrollDown".action = move-column-right;
"Mod+Shift+WheelScrollUp".action = move-column-left;
"Mod+Tab".action = focus-workspace-previous;
"Mod+F".action = maximize-column;
"Mod+W".action = set-column-width "-10%";
"Mod+X".action = set-column-width "+10%";
"Mod+Shift+W".action = set-window-height "-10%";
"Mod+Shift+X".action = set-window-height "+10%";
"Print".action = screenshot-screen;
"Shift+Print".action = screenshot;
"Alt+Print".action = screenshot-window;
"Mod+Shift+Backspace" = {
action = quit { skip-confirmation = true; };
};
};
};
};
}