configuration.nix/home/gui/default.nix

132 lines
3.4 KiB
Nix
Raw Normal View History

{
config,
lib,
pkgs,
osConfig ? null,
...
}:
let
inherit (config) jhome;
flatpakEnabled = if osConfig != null then osConfig.services.flatpak.enable else false;
2024-01-22 11:08:48 +01:00
osSway = osConfig == null && !osConfig.programs.sway.enable;
swayPkg = if osSway then pkgs.sway else null;
cfg = jhome.gui;
cursor.package = pkgs.nordzy-cursor-theme;
cursor.name = "Nordzy-cursors";
iconTheme.name = "Papirus-Dark";
iconTheme.package = pkgs.papirus-icon-theme;
in
{
config = lib.mkIf (jhome.enable && cfg.enable) {
2024-04-12 21:55:51 +02:00
home.packages =
with pkgs;
[
webcord
ferdium
xournalpp
signal-desktop
lxqt.pcmanfm-qt
wl-clipboard
# Extra fonts
noto-fonts-cjk # Chinese, Japanese and Korean characters
]
++ lib.optional flatpakEnabled flatpak;
fonts.fontconfig.enable = true;
# Browser
programs.firefox.enable = true;
# Dynamic Menu
2024-04-12 21:55:51 +02:00
programs.fuzzel = {
enable = true;
settings.main = {
icon-theme = "Papirus-Dark";
terminal = cfg.terminal;
layer = "overlay";
};
};
# Video player
2024-04-12 21:55:51 +02:00
programs.mpv = {
enable = true;
scripts = builtins.attrValues { inherit (pkgs.mpvScripts) uosc thumbfast; };
};
# Status bar
2024-04-12 21:55:51 +02:00
programs.waybar = {
enable = true;
systemd.enable = true;
settings = import ./waybar-settings.nix { inherit config lib; };
};
# Terminal
2024-04-12 21:55:51 +02:00
programs.wezterm = {
enable = cfg.terminal == "wezterm";
extraConfig = ''
config = {}
config.hide_tab_bar_if_only_one_tab = true
config.window_padding = { left = 1, right = 1, top = 1, bottom = 1 }
return config
'';
};
programs.alacritty.enable = cfg.terminal == "alacritty";
programs.zellij.enable = cfg.terminal == "alacritty"; # alacritty has no terminal multiplexerr built in
# PDF reader
programs.zathura.enable = true;
# Auto start sway
programs.zsh.loginExtra = lib.optionalString cfg.sway.autostart ''
# Start Sway on login to TTY 1
if [ "$TTY" = /dev/tty1 ]; then
exec sway
fi
'';
2024-01-25 20:08:18 +01:00
# Volume/Backlight control and notifications
services.avizo = {
enable = true;
settings.default = {
time = 0.8;
border-width = 0;
height = 176;
y-offset = 0.1;
block-spacing = 1;
};
};
2024-04-12 22:00:33 +02:00
# Sound tuning
services.easyeffects.enable = true;
# Auto configure displays
services.kanshi.enable = lib.mkDefault true;
# Notifications
services.mako = {
enable = true;
layer = "overlay";
borderRadius = 8;
defaultTimeout = 15000;
};
# Window Manager
wayland.windowManager.sway = {
enable = true;
package = swayPkg; # no sway package if it comes from the OS
config = import ./sway-config.nix { inherit config pkgs; };
};
# Set cursor style
stylix.cursor = cursor;
home.pointerCursor.gtk.enable = true;
# Set Gtk theme
gtk = {
enable = true;
iconTheme = iconTheme;
gtk3.extraConfig.gtk-application-prefer-dark-theme = 1;
gtk4.extraConfig.gtk-application-prefer-dark-theme = 1;
};
# Set Qt theme
qt = {
enable = true;
platformTheme.name = "gtk";
};
xdg.systemDirs.data = [
"/usr/share"
"/var/lib/flatpak/exports/share"
"${config.xdg.dataHome}/flatpak/exports/share"
];
};
}