2024-04-05 11:55:35 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
osConfig ? null,
|
|
|
|
...
|
2024-07-03 23:58:26 +02:00
|
|
|
}:
|
|
|
|
let
|
2024-01-21 20:56:00 +01:00
|
|
|
inherit (config) jhome;
|
2024-07-03 23:58:26 +02:00
|
|
|
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;
|
2024-07-03 23:58:26 +02:00
|
|
|
swayPkg = if osSway then pkgs.sway else null;
|
2024-01-21 20:56:00 +01:00
|
|
|
cfg = jhome.gui;
|
2024-05-20 14:15:45 +02:00
|
|
|
cursor = {
|
|
|
|
package = pkgs.nordzy-cursor-theme;
|
|
|
|
name = "Nordzy-cursors";
|
|
|
|
};
|
|
|
|
iconTheme = {
|
|
|
|
name = "Papirus-Dark";
|
|
|
|
package = pkgs.papirus-icon-theme;
|
|
|
|
};
|
2024-07-03 23:58:26 +02:00
|
|
|
in
|
|
|
|
{
|
2024-01-21 20:56:00 +01:00
|
|
|
config = lib.mkIf (jhome.enable && cfg.enable) {
|
2024-07-03 23:58:26 +02:00
|
|
|
home.packages =
|
2024-08-24 23:30:39 +02:00
|
|
|
(with pkgs; [
|
2024-04-12 21:55:51 +02:00
|
|
|
webcord
|
|
|
|
ferdium
|
|
|
|
xournalpp
|
|
|
|
signal-desktop
|
|
|
|
lxqt.pcmanfm-qt
|
|
|
|
wl-clipboard
|
|
|
|
# Extra fonts
|
2024-11-20 18:00:09 +01:00
|
|
|
noto-fonts-cjk-sans # Chinese, Japanese and Korean characters
|
|
|
|
noto-fonts-cjk-serif # Chinese, Japanese and Korean characters
|
2024-08-24 23:30:39 +02:00
|
|
|
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
|
|
|
|
])
|
|
|
|
++ lib.optional flatpakEnabled pkgs.flatpak;
|
2024-05-20 14:15:45 +02:00
|
|
|
fonts.fontconfig = {
|
|
|
|
enable = true;
|
2024-06-01 16:24:05 +02:00
|
|
|
defaultFonts = lib.mkIf config.jhome.styling.enable {
|
2024-07-03 23:58:26 +02:00
|
|
|
emoji = [ "Noto Color Emoji" ];
|
|
|
|
monospace = [
|
|
|
|
"JetBrains Mono"
|
|
|
|
"Symbols Nerd Font"
|
|
|
|
];
|
|
|
|
serif = [
|
|
|
|
"Noto Serif"
|
|
|
|
"Symbols Nerd Font"
|
|
|
|
];
|
|
|
|
sansSerif = [
|
|
|
|
"Noto Sans"
|
|
|
|
"Symbols Nerd Font"
|
|
|
|
];
|
2024-05-20 14:15:45 +02:00
|
|
|
};
|
|
|
|
};
|
2024-01-21 20:56:00 +01:00
|
|
|
# Browser
|
2024-05-17 18:50:01 +02:00
|
|
|
programs = {
|
|
|
|
firefox.enable = true;
|
|
|
|
# Dynamic Menu
|
|
|
|
fuzzel = {
|
|
|
|
enable = true;
|
2024-06-01 16:24:05 +02:00
|
|
|
settings.main = lib.mkIf config.jhome.styling.enable {
|
2024-05-17 18:50:01 +02:00
|
|
|
icon-theme = "Papirus-Dark";
|
|
|
|
inherit (cfg) terminal;
|
|
|
|
layer = "overlay";
|
|
|
|
};
|
2024-04-12 21:55:51 +02:00
|
|
|
};
|
2024-05-17 18:50:01 +02:00
|
|
|
# Video player
|
|
|
|
mpv = {
|
|
|
|
enable = true;
|
2024-07-03 23:58:26 +02:00
|
|
|
scripts = builtins.attrValues { inherit (pkgs.mpvScripts) uosc thumbfast; };
|
2024-05-17 18:50:01 +02:00
|
|
|
};
|
|
|
|
# Status bar
|
|
|
|
waybar = {
|
|
|
|
enable = true;
|
|
|
|
systemd.enable = true;
|
2024-07-03 23:58:26 +02:00
|
|
|
settings = lib.mkIf config.jhome.styling.enable (
|
|
|
|
import ./waybar-settings.nix { inherit config lib; }
|
|
|
|
);
|
2024-11-20 21:34:11 +01:00
|
|
|
style =
|
|
|
|
lib.optionalString config.jhome.styling.enable # css
|
|
|
|
''
|
|
|
|
.modules-left #workspaces button {
|
|
|
|
border-bottom: 3px solid @base01;
|
|
|
|
}
|
|
|
|
.modules-left #workspaces button.persistent {
|
|
|
|
border-bottom: 3px solid transparent;
|
|
|
|
}
|
|
|
|
'';
|
2024-05-17 18:50:01 +02:00
|
|
|
};
|
|
|
|
# Terminal
|
|
|
|
wezterm = {
|
|
|
|
enable = cfg.terminal == "wezterm";
|
2024-11-20 21:34:11 +01:00
|
|
|
extraConfig =
|
|
|
|
lib.optionalString config.jhome.styling.enable # lua
|
|
|
|
''
|
|
|
|
local wezterm = require("wezterm")
|
|
|
|
|
|
|
|
local config = wezterm.config_builder()
|
|
|
|
|
|
|
|
config.front_end = "WebGpu"
|
|
|
|
config.hide_tab_bar_if_only_one_tab = true
|
|
|
|
config.window_padding = { left = 1, right = 1, top = 1, bottom = 1 }
|
|
|
|
|
|
|
|
return config
|
|
|
|
'';
|
2024-05-17 18:50:01 +02:00
|
|
|
};
|
|
|
|
alacritty.enable = cfg.terminal == "alacritty";
|
2024-06-01 16:24:05 +02:00
|
|
|
zellij.enable = cfg.terminal == "alacritty"; # alacritty has no terminal multiplexer built-in
|
2024-05-17 18:50:01 +02:00
|
|
|
# PDF reader
|
|
|
|
zathura.enable = true;
|
|
|
|
# Auto start sway
|
2024-11-20 21:34:11 +01:00
|
|
|
zsh.loginExtra =
|
|
|
|
lib.optionalString cfg.sway.autostart # sh
|
|
|
|
''
|
|
|
|
# Start Sway on login to TTY 1
|
|
|
|
if [ "$TTY" = /dev/tty1 ]; then
|
|
|
|
exec sway
|
|
|
|
fi
|
|
|
|
'';
|
2024-04-12 21:55:51 +02:00
|
|
|
};
|
2024-05-17 18:50:01 +02:00
|
|
|
services = {
|
|
|
|
# Volume/Backlight control and notifications
|
|
|
|
avizo = {
|
|
|
|
enable = true;
|
|
|
|
settings.default = {
|
|
|
|
time = 0.8;
|
|
|
|
border-width = 0;
|
|
|
|
height = 176;
|
|
|
|
y-offset = 0.1;
|
|
|
|
block-spacing = 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# Sound tuning
|
|
|
|
easyeffects.enable = true;
|
|
|
|
# Auto configure displays
|
|
|
|
kanshi.enable = lib.mkDefault true;
|
|
|
|
# Notifications
|
|
|
|
mako = {
|
|
|
|
enable = true;
|
|
|
|
layer = "overlay";
|
|
|
|
borderRadius = 8;
|
|
|
|
defaultTimeout = 15000;
|
2024-04-10 18:46:12 +02:00
|
|
|
};
|
|
|
|
};
|
2024-05-17 18:50:01 +02:00
|
|
|
|
2024-01-21 20:56:00 +01:00
|
|
|
# Window Manager
|
2024-04-10 18:46:12 +02:00
|
|
|
wayland.windowManager.sway = {
|
2024-06-01 16:24:05 +02:00
|
|
|
inherit (cfg.sway) enable;
|
2024-04-10 18:46:12 +02:00
|
|
|
package = swayPkg; # no sway package if it comes from the OS
|
2024-07-03 23:58:26 +02:00
|
|
|
config = import ./sway-config.nix { inherit config pkgs; };
|
2024-08-24 23:30:39 +02:00
|
|
|
systemd = {
|
|
|
|
enable = true;
|
|
|
|
xdgAutostart = true;
|
|
|
|
};
|
2024-04-10 18:46:12 +02:00
|
|
|
};
|
2024-01-21 20:56:00 +01:00
|
|
|
|
|
|
|
# Set cursor style
|
2024-07-03 23:58:26 +02:00
|
|
|
stylix = lib.mkIf config.jhome.styling.enable { inherit cursor; };
|
|
|
|
home.pointerCursor = lib.mkIf config.jhome.styling.enable (
|
|
|
|
lib.mkDefault {
|
|
|
|
gtk.enable = true;
|
|
|
|
inherit (cursor) name package;
|
|
|
|
}
|
|
|
|
);
|
2024-01-21 20:56:00 +01:00
|
|
|
# Set Gtk theme
|
2024-06-01 16:24:05 +02:00
|
|
|
gtk = lib.mkIf config.jhome.styling.enable {
|
2024-04-10 18:46:12 +02:00
|
|
|
enable = true;
|
2024-05-17 18:50:01 +02:00
|
|
|
inherit iconTheme;
|
2024-04-10 18:46:12 +02:00
|
|
|
gtk3.extraConfig.gtk-application-prefer-dark-theme = 1;
|
|
|
|
gtk4.extraConfig.gtk-application-prefer-dark-theme = 1;
|
|
|
|
};
|
2024-01-21 20:56:00 +01:00
|
|
|
# Set Qt theme
|
2024-06-01 16:24:05 +02:00
|
|
|
qt = lib.mkIf config.jhome.styling.enable {
|
2024-04-10 18:46:12 +02:00
|
|
|
enable = true;
|
2024-04-19 18:18:02 +02:00
|
|
|
platformTheme.name = "gtk";
|
2024-04-10 18:46:12 +02:00
|
|
|
};
|
2024-01-21 20:56:00 +01:00
|
|
|
|
|
|
|
xdg.systemDirs.data = [
|
|
|
|
"/usr/share"
|
|
|
|
"/var/lib/flatpak/exports/share"
|
|
|
|
"${config.xdg.dataHome}/flatpak/exports/share"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|