nixos-config/common/home.nix

454 lines
11 KiB
Nix
Raw Normal View History

2024-10-15 09:45:54 +02:00
{ config, pkgs, ... }:
2024-09-30 14:40:45 +02:00
{
home.username = "ahurac";
home.homeDirectory = "/home/ahurac";
home.stateVersion = "24.05";
home.packages = with pkgs; [
2024-11-19 18:36:23 +01:00
pulseaudio
2024-11-14 13:52:18 +01:00
d2
2024-11-14 13:52:29 +01:00
cargo
2024-11-12 19:52:21 +01:00
tinymist
2024-11-12 18:06:54 +01:00
typst
2024-11-12 15:31:13 +01:00
ipcalc
2024-11-12 10:59:58 +01:00
thunderbird
2024-11-11 00:12:38 +01:00
python3
2024-11-05 16:20:13 +01:00
swaybg
2024-11-04 13:51:28 +01:00
catimg
2024-10-21 11:39:19 +02:00
virt-manager
2024-10-15 18:48:00 +02:00
unzip
2024-10-09 13:56:33 +02:00
nil
2024-09-30 14:40:45 +02:00
pavucontrol
wl-clipboard
prismlauncher
noto-fonts
libreoffice
mosh
gnumake
man-pages
man-pages-posix
gdb
gcc
valgrind
2024-10-01 11:51:08 +02:00
cloc
2024-10-06 15:12:37 +02:00
nodejs_22
2024-10-07 15:17:46 +02:00
libnotify
2024-09-30 14:40:45 +02:00
(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";
};
2024-10-22 10:48:08 +02:00
font.name = "Noto Sans";
font.size = 11;
2024-09-30 14:40:45 +02:00
};
2024-10-15 10:47:44 +02:00
xdg.portal = {
enable = true;
config.common.default = [ "gnome" "gtk" ];
2024-10-21 11:39:05 +02:00
extraPortals = [ pkgs.xdg-desktop-portal-gnome ];
2024-10-15 10:47:44 +02:00
};
2024-10-11 19:57:49 +02:00
2024-09-30 15:36:41 +02:00
services.ssh-agent.enable = true;
2024-11-09 22:18:07 +01:00
services.swayosd.enable = true;
2024-09-30 15:36:41 +02:00
services.flatpak.packages = [
"im.riot.Riot"
"io.github.spacingbat3.webcord"
"net.cozic.joplin_desktop"
2024-10-01 11:51:23 +02:00
"dev.aunetx.deezer"
2024-10-07 15:38:54 +02:00
"com.jgraph.drawio.desktop"
2024-11-05 11:10:27 +01:00
"com.bitwarden.desktop"
];
2024-10-01 11:34:48 +02:00
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";
2024-10-01 13:47:23 +02:00
GTK_THEME = "adw-gtk3-dark";
2024-10-01 11:34:48 +02:00
};
};
};
2024-10-01 11:22:05 +02:00
programs.librewolf.enable = true;
2024-09-30 14:40:45 +02:00
programs.kitty.enable = true;
programs.helix = {
enable = true;
package = pkgs.evil-helix;
2024-10-06 15:25:36 +02:00
settings = { editor.soft-wrap.enable = true; };
2024-11-15 11:09:44 +01:00
extraPackages = with pkgs; [
clang-tools
rust-analyzer
jdt-language-server
bash-language-server
2024-11-15 11:12:43 +01:00
marksman
python3Packages.python-lsp-server
2024-11-15 11:09:44 +01:00
];
2024-09-30 14:40:45 +02:00
languages.language = [
{
name = "nix";
auto-format = true;
2024-11-12 10:41:41 +01:00
formatter.command = "${pkgs.nixfmt-classic}/bin/nixfmt";
2024-09-30 14:40:45 +02:00
}
{
name = "c";
auto-format = true;
2024-11-12 10:41:41 +01:00
formatter.command = "${pkgs.clang-tools}/bin/clang-format";
2024-09-30 14:40:45 +02:00
}
2024-10-07 13:49:21 +02:00
{
name = "bash";
auto-format = true;
2024-11-12 10:41:41 +01:00
formatter.command = "${pkgs.shfmt}/bin/shfmt";
}
{
name = "java";
auto-format = true;
2024-11-19 10:08:26 +01:00
formatter = {
command = "${pkgs.google-java-format}/bin/google-java-format";
args = [ "-" ];
};
2024-10-07 13:49:21 +02:00
}
2024-11-14 13:52:29 +01:00
{
name = "rust";
auto-format = true;
formatter.command = "${pkgs.rustfmt}/bin/rustfmt";
}
{
name = "python";
auto-format = true;
formatter.command = "${pkgs.yapf}/bin/yapf";
}
2024-09-30 14:40:45 +02:00
];
};
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";
2024-11-19 08:53:36 +01:00
graph = "log --graph --oneline --all";
2024-11-19 10:29:21 +01:00
b = "branch";
2024-09-30 14:40:45 +02:00
sh = "show";
ds = "diff --staged";
};
userEmail = "ahurac@mailbox.org";
userName = "Ahurac";
extraConfig = {
init.defaultBranch = "main";
push.autoSetupRemote = true;
2024-11-08 19:36:20 +01:00
pull.rebase = false;
2024-09-30 14:40:45 +02:00
};
};
programs.zsh = {
enable = true;
shellAliases = {
g = "git";
j = "jobs";
2024-09-30 15:36:55 +02:00
sshm = "ssh -M";
2024-10-07 13:50:07 +02:00
pd = "pushd";
2024-10-08 11:01:32 +02:00
wlc = "wl-copy";
2024-11-05 14:08:54 +01:00
lw = "librewolf";
2024-09-30 14:40:45 +02:00
};
plugins = [{
name = "vi-mode";
src = pkgs.zsh-vi-mode;
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
}];
2024-10-07 11:48:03 +02:00
initExtra = ''
mkcdir() {
mkdir -p -- "$@" && cd -- "$1"
}
2024-10-08 11:01:32 +02:00
getpwd() {
rbw get "$@" | wl-copy
}
2024-10-07 11:48:03 +02:00
'';
2024-09-30 14:40:45 +02:00
};
2024-10-22 09:54:54 +02:00
programs.swaylock = {
enable = true;
settings = {
color = "202020";
font-size = 24;
font = "Noto Sans";
indicator-radius = 100;
line-uses-ring = true;
separator-color = "00000000";
};
};
2024-10-08 10:10:30 +02:00
programs.anyrun = {
enable = true;
package = pkgs.anyrun;
2024-10-08 10:10:30 +02:00
config = {
plugins = [ "libapplications.so" ];
2024-10-08 10:10:30 +02:00
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;
}
'';
};
2024-10-10 21:26:31 +02:00
2024-10-14 14:08:56 +02:00
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";
};
};
};
2024-10-11 19:45:50 +02:00
2024-11-05 11:37:02 +01:00
services.swaync = {
enable = true;
settings = {
positionX = "center";
positionY = "bottom";
control-center-positionX = "center";
control-center-positionY = "bottom";
control-center-margin-bottom = 10;
fit-to-screen = false;
control-center-height = 600;
};
};
2024-10-14 15:04:55 +02:00
2024-10-15 09:45:54 +02:00
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-column-widths = [ { proportion = 0.5; } { proportion = 1.0; } ];
2024-11-05 15:13:35 +01:00
preset-window-heights = [ { proportion = 0.5; } { proportion = 1.0; } ];
2024-10-15 09:45:54 +02:00
focus-ring.enable = false;
border = {
enable = true;
width = 2;
inactive.color = "#80808080";
};
center-focused-column = "never";
2024-10-15 09:45:54 +02:00
};
workspaces = {
w1.name = "admin";
w2.name = "everything";
w3.name = "apps";
};
hotkey-overlay.skip-at-startup = true;
2024-10-15 09:45:54 +02:00
window-rules = [
{
matches =
[{ app-id = "^(im\\.riot\\.Riot|WebCord|@joplin/app-desktop)$"; }];
open-on-workspace = "apps";
default-column-width.proportion = 1.0;
2024-10-15 09:45:54 +02:00
}
{
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;
2024-11-05 15:04:35 +01:00
screenshot-path = "~/screenshots/%Y%m%d%H%M%S.png";
2024-10-15 09:45:54 +02:00
binds = with config.lib.niri.actions; {
"Mod+Space".action = spawn "alacritty";
2024-11-05 10:52:08 +01:00
"Mod+Shift+Space".action = spawn "alacritty" "-e" "sudo" "-i";
2024-10-15 09:45:54 +02:00
"Mod+F1".action = spawn "anyrun";
2024-11-05 15:04:48 +01:00
"Mod+F2".action = spawn "flatpak" "run" "net.cozic.joplin_desktop";
"Mod+F3".action = spawn "flatpak" "run" "im.riot.Riot";
"Mod+F4".action = spawn "flatpak" "run" "io.github.spacingbat3.webcord";
"Mod+F5".action = spawn "flatpak" "run" "dev.aunetx.deezer";
2024-10-15 10:46:36 +02:00
"Mod+L".action = spawn "swaylock";
2024-10-15 09:45:54 +02:00
"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 = consume-or-expel-window-left;
2024-10-15 09:45:54 +02:00
"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 = consume-or-expel-window-right;
2024-10-15 09:45:54 +02:00
"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;
2024-11-19 18:36:23 +01:00
"Mod+N".action = spawn "swaync-client" "--toggle-panel";
2024-10-15 09:45:54 +02:00
"Mod+Tab".action = focus-workspace-previous;
"Mod+Shift+W".action = maximize-column;
2024-11-05 15:09:21 +01:00
"Mod+W".action = switch-preset-column-width;
"Mod+X".action = switch-preset-window-height;
"Mod+E".action = set-column-width "-10%";
"Mod+R".action = set-column-width "+10%";
2024-10-15 09:45:54 +02:00
"Print".action = screenshot-screen;
"Shift+Print".action = screenshot;
"Alt+Print".action = screenshot-window;
"Mod+Shift+Backspace" = {
action = quit { skip-confirmation = true; };
};
2024-11-05 10:51:50 +01:00
"XF86MonBrightnessDown" = {
allow-when-locked = true;
action = spawn "swayosd-client" "--brightness=lower";
};
"XF86MonBrightnessUp" = {
allow-when-locked = true;
action = spawn "swayosd-client" "--brightness=raise";
};
"XF86AudioRaiseVolume" = {
allow-when-locked = true;
action = spawn "swayosd-client" "--output-volume=raise";
};
"XF86AudioLowerVolume" = {
allow-when-locked = true;
action = spawn "swayosd-client" "--output-volume=lower";
};
"XF86AudioMute" = {
allow-when-locked = true;
action = spawn "swayosd-client" "--output-volume=mute-toggle";
};
2024-10-15 09:45:54 +02:00
};
2024-11-05 10:34:31 +01:00
spawn-at-startup = [
{ command = [ "eww" "daemon" ]; }
{
command = [
"swaybg"
"-i"
"/home/ahurac/.local/share/backgrounds/default.png"
"-m"
"fill"
];
}
2024-11-05 10:34:31 +01:00
];
2024-10-15 09:45:54 +02:00
};
};
2024-11-05 10:34:04 +01:00
2024-11-09 22:17:59 +01:00
programs.mpv.enable = true;
programs.jq.enable = true;
programs.fastfetch.enable = true;
2024-11-19 13:55:47 +01:00
programs.eww = {
enable = true;
configDir = ./eww;
};
2024-09-30 14:40:45 +02:00
}