uhhh
uhhh the 2nd rendition
This commit is contained in:
parent
132a109da8
commit
565aac949c
37 changed files with 2606 additions and 36 deletions
47
modules/desktop/default.nix
Normal file
47
modules/desktop/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop;
|
||||
in {
|
||||
options.modules.desktop = {
|
||||
envProto = mkOption {
|
||||
type = types.nullOr (types.enum ["x11" "wayland"]);
|
||||
description = "What display protocol to use";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
{
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme = "gnome";
|
||||
style = "adwaita-dark";
|
||||
};
|
||||
|
||||
modules.desktop.fonts.enable = builtins.trace "enabling fonts" true;
|
||||
modules.desktop.fonts.baseFonts = builtins.trace "enabling basefonts" true;
|
||||
}
|
||||
(mkIf (cfg.envProto == "wayland") {
|
||||
hm.home.packages = with pkgs; [ wl-clipboard-x11 ];
|
||||
|
||||
environment.sessionVariables = {
|
||||
# magic, dont ask
|
||||
NIXOS_OZONE_WL = "1";
|
||||
_JAVA_AWT_WM_NONEREPARENTING = "1";
|
||||
GDK_BACKEND = "wayland,x11";
|
||||
ANKI_WAYLAND = "1";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
SDL_VIDEODRIVER = "wayland";
|
||||
CLUTTER_BACKEND = "wayland";
|
||||
# this fixes cursors on nvidia, maybe move all nvidia stuff to a module? or put this in hardware
|
||||
WLR_NO_HARDWARE_CURSORS = "1";
|
||||
};
|
||||
})
|
||||
(mkIf (cfg.envProto == "x11") {
|
||||
hm.home.packages = with pkgs; [ xclip ];
|
||||
|
||||
services.xserver.excludePackages = [ pkgs.xterm ];
|
||||
})
|
||||
];
|
||||
}
|
17
modules/desktop/dunst.nix
Normal file
17
modules/desktop/dunst.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.dunst;
|
||||
in {
|
||||
options.modules.desktop.dunst = {
|
||||
enable = mkEnableOption "Enable dunst, a lightweight replacement for the notification daemons provided by most desktop environments";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.services.dunst = {
|
||||
enable = true;
|
||||
configFile = ../../config/dunst.conf;
|
||||
};
|
||||
};
|
||||
}
|
117
modules/desktop/fonts.nix
Normal file
117
modules/desktop/fonts.nix
Normal file
|
@ -0,0 +1,117 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
# ty https://github.com/Misterio77/nix-config/blob/main/modules/home-manager/fonts.nix
|
||||
mkFontOption = kind: default: {
|
||||
family = mkOption {
|
||||
type = types.str;
|
||||
default = default.family;
|
||||
description = "Family name for ${kind} font profile";
|
||||
example = "Fira Code";
|
||||
};
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = default.package;
|
||||
description = "Package for ${kind} font profile";
|
||||
example = "pkgs.fira-code";
|
||||
};
|
||||
size = mkOption {
|
||||
type = types.number;
|
||||
default = default.size;
|
||||
description = "${kind} font profile size, px";
|
||||
example = "11";
|
||||
};
|
||||
};
|
||||
cfg = config.modules.desktop.fonts;
|
||||
in {
|
||||
options.modules.desktop.fonts = {
|
||||
enable = mkEnableOption "Enable the font configuration module, containing system fonts";
|
||||
baseFonts = mkEnableOption "Add an extra set of extra base fonts";
|
||||
|
||||
fonts = {
|
||||
sans = mkFontOption "sans" {
|
||||
package = pkgs.my.atkinson-hyperlegible-pro;
|
||||
family = "Atkinson Hyperlegible Pro";
|
||||
|
||||
size = 11;
|
||||
};
|
||||
sansSerif = mkFontOption "sans-serif" {
|
||||
package = pkgs.my.atkinson-hyperlegible-pro;
|
||||
family = "Atkinson Hyperlegible Pro";
|
||||
|
||||
size = 11;
|
||||
};
|
||||
monospace = mkFontOption "monospace" {
|
||||
package = pkgs.cozette;
|
||||
family = "CozetteVector";
|
||||
|
||||
size = 10;
|
||||
};
|
||||
monospaceBitmap = mkFontOption "bitmap monospace" {
|
||||
package = pkgs.cozette;
|
||||
family = "Cozette";
|
||||
|
||||
size = 10;
|
||||
};
|
||||
emoji = mkFontOption "emoji" {
|
||||
package = pkgs.twitter-color-emoji;
|
||||
family = "Twitter Color Emoji";
|
||||
|
||||
size = 10; # not applicable, but whatever
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
fonts = {
|
||||
fontDir.enable = true;
|
||||
fontconfig.enable = true;
|
||||
fontconfig.defaultFonts = {
|
||||
sans = [ cfg.fonts.sans.family ];
|
||||
sansSerif = [ cfg.fonts.sansSerif.family ];
|
||||
monospace = [ cfg.fonts.monospace.family ];
|
||||
emoji = [ cfg.fonts.emoji.family ];
|
||||
};
|
||||
enableGhostscriptFonts = true;
|
||||
packages = with pkgs; [
|
||||
corefonts
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
liberation_ttf
|
||||
] ++ [
|
||||
cfg.fonts.sans.package
|
||||
cfg.fonts.sansSerif.package
|
||||
cfg.fonts.monospace.package
|
||||
cfg.fonts.monospaceBitmap.package
|
||||
cfg.fonts.emoji.package
|
||||
];
|
||||
};
|
||||
|
||||
hm.gtk.enable = true;
|
||||
hm.gtk.font = {
|
||||
inherit (cfg.fonts.sans) package name size;
|
||||
};
|
||||
|
||||
hm.dconf.settings = {
|
||||
"org/gnome/desktop/interface".font-name = with cfg.fonts.sans; "${family} ${toString size}";
|
||||
"org/gnome/desktop/interface".document-font-name = with cfg.fonts.sansSerif; "${family} ${toString size}";
|
||||
"org/gnome/desktop/interface".monospace-font-name = with cfg.fonts.monospace; "${family} ${toString size}";
|
||||
};
|
||||
} // (mkIf cfg.baseFonts {
|
||||
fonts.enableDefaultPackages = true;
|
||||
fonts.packages = with pkgs; [
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
mplus-outline-fonts.githubRelease
|
||||
dina-font
|
||||
proggyfonts
|
||||
atkinson-hyperlegible
|
||||
cozette
|
||||
twemoji-color-font
|
||||
noto-fonts-color-emoji
|
||||
noto-fonts-monochrome-emoji
|
||||
font-awesome
|
||||
];
|
||||
});
|
||||
}
|
43
modules/desktop/hypridle.nix
Normal file
43
modules/desktop/hypridle.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ lib, config, pkgs, system, inputs , ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.hypridle;
|
||||
in {
|
||||
options.modules.desktop.hypridle = {
|
||||
enable = mkEnableOption "Enable hypridle, hyprland's idle daemon";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = inputs.hypridle.packages.${system}.hypridle;
|
||||
example = "pkgs.hypridle";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.services.hypridle = {
|
||||
enable = true;
|
||||
package = cfg.package;
|
||||
|
||||
lockCmd = "${lib.getExe config.modules.desktop.hyprlock.package}";
|
||||
unlockCmd = "pkill -USR1 hyprlock";
|
||||
|
||||
listeners = let
|
||||
hyprctl = "${config.modules.desktop.hyprland.package}/bin/hyprctl";
|
||||
in [
|
||||
{
|
||||
timeout = 90; # 1.5 min
|
||||
onTimeout = "${hyprctl} dispatch dpms off"; # turn off screen
|
||||
onResume = "${hyprctl} dispatch dpms on"; # turn it back on
|
||||
}
|
||||
{
|
||||
timeout = 60 * 2; # 2 min
|
||||
onTimeout = "loginctl lock-session"; # lock computer
|
||||
}
|
||||
{
|
||||
timeout = 60 * 30; # 15 min
|
||||
onTimeout = "systemctl suspend"; # sleep/suspend
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
201
modules/desktop/hyprland.nix
Normal file
201
modules/desktop/hyprland.nix
Normal file
|
@ -0,0 +1,201 @@
|
|||
{ inputs, lib, config, system, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.hyprland;
|
||||
hyprpkgs = inputs.hyprland.packages.${system};
|
||||
in {
|
||||
options.modules.desktop.hyprland = {
|
||||
enable = mkEnableOption "Enable hyprland, a dynamic tiling wayland compositor based on wlroots that doesn't sacrifice on its looks";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = hyprpkgs.hyprland;
|
||||
example = "pkgs.hyprland";
|
||||
};
|
||||
portalPackage = mkOption {
|
||||
type = types.package;
|
||||
default = hyprpkgs.xdg-desktop-portal-hyprland;
|
||||
example = "pkgs.xdg-desktop-portal-hyprland";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.xserver.displayManager.sessionPackages = [ cfg.package ];
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk cfg.portalPackage ];
|
||||
config = {
|
||||
common = {
|
||||
default = [ "hyprland" "gtk" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
hm.wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
package = cfg.package;
|
||||
|
||||
settings = {
|
||||
source = [];
|
||||
|
||||
"$mod" = "SUPER";
|
||||
bindm = [ # "bind mouse"
|
||||
# move/resize windows with mod + lmb/rmb and dragging
|
||||
"$mod, mouse:272, movewindow"
|
||||
"$mod, mouse:273, resizewindow"
|
||||
];
|
||||
bindel = [ # "bind held & locked"
|
||||
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 10%+"
|
||||
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%-"
|
||||
];
|
||||
bindl = [ # "bind locked"
|
||||
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
];
|
||||
bindr = [ # "bind released"
|
||||
"SUPER, Super_L, exec, ${lib.getExe pkgs.nwg-drawer}"
|
||||
];
|
||||
bind = [
|
||||
"$mod, R, exec, ${lib.getExe pkgs.rofi-wayland} -show run"
|
||||
", print, exec, ${lib.getExe pkgs.grimblast} copy area"
|
||||
"$mod, T, exec, ${lib.getExe pkgs.wezterm}"
|
||||
|
||||
"$mod, Q, killactive, "
|
||||
"$mod, V, togglefloating, "
|
||||
"$mod, P, pseudo, "
|
||||
"$mod, J, togglesplit, "
|
||||
|
||||
# scroll through workspaces with mod + scroll
|
||||
"$mod, mouse_down, workspace, e+1"
|
||||
"$mod, mouse_up, workspace, e-1"
|
||||
] ++ (
|
||||
# workspaces
|
||||
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
|
||||
builtins.concatLists (builtins.genList (
|
||||
x: let
|
||||
ws = let
|
||||
c = (x + 1) / 10;
|
||||
in
|
||||
builtins.toString (x + 1 - (c * 10));
|
||||
in [
|
||||
"$mod, ${ws}, workspace, ${toString (x + 1)}"
|
||||
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
|
||||
]
|
||||
)
|
||||
10)
|
||||
);
|
||||
|
||||
input = {
|
||||
kb_layout = "us";
|
||||
|
||||
follow_mouse = 1;
|
||||
};
|
||||
|
||||
monitor= [
|
||||
"DVI-D-1, 1920x1080@60, 0x0, 1"
|
||||
"DP-1, 1920x1080@60, 1920x0, 1"
|
||||
];
|
||||
|
||||
exec-once = [ "${lib.getExe pkgs.networkmanagerapplet}" ];
|
||||
|
||||
env = [
|
||||
"XCURSOR_THEME,${config.modules.desktop.themes.cursorTheme.name}"
|
||||
"XCURSOR_SIZE,24"
|
||||
];
|
||||
|
||||
general = {
|
||||
gaps_in = 6;
|
||||
gaps_out = 6;
|
||||
border_size = 2;
|
||||
no_border_on_floating = true;
|
||||
|
||||
layout = "dwindle";
|
||||
|
||||
resize_on_border = true;
|
||||
};
|
||||
|
||||
windowrulev2 = [
|
||||
# common popups
|
||||
"float, class:file-roller"
|
||||
"float, class:org.gnome.Loupe"
|
||||
"float, initialTitle:^Open Folder$"
|
||||
"float, initialTitle:^Open File$"
|
||||
|
||||
# fix focus
|
||||
"stayfocused, class:^pinentry-"
|
||||
"stayfocused, class:^rofi-"
|
||||
|
||||
# workspace moving
|
||||
"workspace 1, class:^firefox"
|
||||
"workspace 2, class:code-url-handler"
|
||||
"workspace 4, class:ArmCord"
|
||||
];
|
||||
|
||||
blurls = [
|
||||
"gtk-layer-shell" # nwg-drawer
|
||||
"waybar"
|
||||
];
|
||||
|
||||
decoration = {
|
||||
rounding = 10;
|
||||
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 4;
|
||||
passes = 2;
|
||||
# popups = true;
|
||||
};
|
||||
|
||||
drop_shadow = false;
|
||||
};
|
||||
|
||||
animations = {
|
||||
enabled = true;
|
||||
|
||||
bezier = [
|
||||
"outCubic, 0.33, 1, 0.68, 1"
|
||||
"outExpo, 0.16, 1, 0.3, 1"
|
||||
];
|
||||
|
||||
animation = [
|
||||
"windows, 1, 5, outExpo, popin"
|
||||
"windowsOut, 1, 5, outCubic, popin 80%"
|
||||
"border, 1, 2, outExpo"
|
||||
"fade, 1, 3, outCubic"
|
||||
"workspaces, 1, 6, outExpo"
|
||||
];
|
||||
};
|
||||
|
||||
dwindle = {
|
||||
pseudotile = "yes";
|
||||
|
||||
preserve_split = "yes";
|
||||
};
|
||||
|
||||
master = {
|
||||
new_is_master = true;
|
||||
};
|
||||
|
||||
misc = {
|
||||
force_default_wallpaper = 0;
|
||||
disable_splash_rendering = true;
|
||||
disable_hyprland_logo = true;
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
general {
|
||||
col.active_border=$pink
|
||||
col.inactive_border=$surface0
|
||||
}
|
||||
decoration {
|
||||
col.shadow=$surface0
|
||||
col.shadow_inactive=$surface0
|
||||
}
|
||||
misc {
|
||||
background_color=$crust
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
72
modules/desktop/hyprlock.nix
Normal file
72
modules/desktop/hyprlock.nix
Normal file
|
@ -0,0 +1,72 @@
|
|||
{ lib, config, inputs, system, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.hyprlock;
|
||||
in {
|
||||
options.modules.desktop.hyprlock = {
|
||||
enable = mkEnableOption "Enable hyprlock, a simple, fast, multithreaded screen lock for hyprland";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = inputs.hyprlock.packages.${system}.hyprlock;
|
||||
example = "pkgs.hyprlock";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
security.pam.services.hyprlock.text = "auth include login";
|
||||
powerManagement.resumeCommands = ''
|
||||
${cfg.package}
|
||||
'';
|
||||
hm.programs.hyprlock = with config.colorScheme.palette; {
|
||||
enable = true;
|
||||
package = cfg.package;
|
||||
general = {
|
||||
hide_cursor = false;
|
||||
no_fade_in = true;
|
||||
no_fade_out = true;
|
||||
};
|
||||
backgrounds = [
|
||||
{
|
||||
path = toString ../../assets/lockscreen.png;
|
||||
blur_passes = 3;
|
||||
blur_size = 6;
|
||||
}
|
||||
];
|
||||
labels = [
|
||||
{
|
||||
text = "cmd[update:1000] echo \"$(date +'%H:%M')\"";
|
||||
font_size = 58;
|
||||
color = "rgb(${base05})";
|
||||
font_family = config.modules.desktop.fonts.fonts.sansSerif.family;
|
||||
position = { x = 0; y = 30; };
|
||||
}
|
||||
{
|
||||
text = "cmd[update:1000] echo \"$(date + '%A %B %e')\"";
|
||||
font_size = 14;
|
||||
color = "rgb(${base05})";
|
||||
font_family = config.modules.desktop.fonts.fonts.sansSerif.family;
|
||||
position = { x = 0; y = 10; };
|
||||
}
|
||||
];
|
||||
input-fields = [
|
||||
{
|
||||
size = { width = 300; height = 28; };
|
||||
outline_thickness = 2;
|
||||
dots_size = 0.2;
|
||||
fade_on_empty = false;
|
||||
placeholder_text = "";
|
||||
|
||||
outer_color = "rgb(${base0E})";
|
||||
inner_color = "rgb(${base00})";
|
||||
font_color = "rgb(${base05})";
|
||||
check_color = "rgb(${base02})";
|
||||
fail_color = "rgb(${base08})";
|
||||
capslock_color = "rgb(${base09})";
|
||||
|
||||
position = { x = 0; y = -30; };
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
28
modules/desktop/hyprpaper.nix
Normal file
28
modules/desktop/hyprpaper.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ lib, config, inputs, system, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.hyprpaper;
|
||||
in {
|
||||
options.modules.desktop.hyprpaper = {
|
||||
enable = mkEnableOption "Enable hyprpaper, a wayland wallpaper utility";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = inputs.hyprpaper.packages.${system}.hyprpaper;
|
||||
example = "pkgs.hyperpaper";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.wayland.windowManager.hyprland.settings.exec-once = [ "${lib.getExe cfg.package}" ];
|
||||
hm.xdg.configFile."hypr/hyprpaper.conf" = let
|
||||
img = ../../assets/wallpaper.png;
|
||||
in {
|
||||
text = ''
|
||||
preload = ${img}
|
||||
wallpaper = ,${img}
|
||||
splash = false
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
18
modules/desktop/nwg-drawer.nix
Normal file
18
modules/desktop/nwg-drawer.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ lib, config, pkgs, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.nwg-drawer;
|
||||
in {
|
||||
options.modules.desktop.nwg-drawer = {
|
||||
enable = mkEnableOption "Enable nwg-drawer, a GTK based application launcher for wayland";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.wayland.windowManager.hyprland.settings.exec-once = [ "${lib.getExe pkgs.nwg-drawer} -r -nofs -nocats -ovl -term wezterm -spacing 15 -fm nautilus" ];
|
||||
hm.xdg.configFile."nwg-drawer/drawer.css".text = builtins.concatStringsSep "\n" [
|
||||
"@import \"${inputs.waybar-catppuccin}/themes/mocha.css\";"
|
||||
(lib.readFile ../../config/nwg-drawer.css)
|
||||
];
|
||||
};
|
||||
}
|
22
modules/desktop/rofi.nix
Normal file
22
modules/desktop/rofi.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.rofi;
|
||||
in {
|
||||
options.modules.desktop.rofi = {
|
||||
enable = mkEnableOption "Enable rofi, a window switcher, run dialog and dmenu replacement";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.programs.rofi = {
|
||||
enable = true;
|
||||
package = pkgs.rofi-wayland;
|
||||
font = with config.modules.desktop.fonts.fonts.monospace; "${family} ${toString size}";
|
||||
extraConfig = {
|
||||
show-icons = true;
|
||||
};
|
||||
theme = ../../config/rofi.rasi;
|
||||
};
|
||||
};
|
||||
}
|
30
modules/desktop/sddm.nix
Normal file
30
modules/desktop/sddm.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.sddm;
|
||||
in {
|
||||
options.modules.desktop.sddm = {
|
||||
enable = mkEnableOption "Enable SDDM, a display manager for X11 and Wayland windowing systems";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.xserver.enable = true; # this is needed, unfortunately!
|
||||
environment.systemPackages = with pkgs; [
|
||||
config.modules.desktop.themes.sddmTheme.package
|
||||
libsForQt5.qt5.qtsvg
|
||||
libsForQt5.qt5.qtgraphicaleffects
|
||||
libsForQt5.qt5.qtquickcontrols2
|
||||
];
|
||||
services.xserver.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
theme = config.modules.desktop.themes.sddmTheme.name;
|
||||
settings = {
|
||||
Theme = {
|
||||
CursorTheme = config.modules.desktop.themes.cursorTheme.name;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
69
modules/desktop/themes/catppuccin/default.nix
Normal file
69
modules/desktop/themes/catppuccin/default.nix
Normal file
|
@ -0,0 +1,69 @@
|
|||
{ inputs, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.themes;
|
||||
accent = "pink";
|
||||
variant = "mocha";
|
||||
in {
|
||||
config = mkIf (cfg.active == "catppuccin") {
|
||||
colorScheme = inputs.nix-colors.colorSchemes.catppuccin-mocha;
|
||||
|
||||
modules.desktop.themes = {
|
||||
dark = true;
|
||||
|
||||
gtkTheme = {
|
||||
name = "Catppuccin-Mocha-Compact-Pink-Dark"; # TODO: put accent in here
|
||||
package = pkgs.catppuccin-gtk.override {
|
||||
variant = variant;
|
||||
accents = [ accent ];
|
||||
tweaks = [ "rimless" ];
|
||||
size = "compact";
|
||||
};
|
||||
};
|
||||
|
||||
iconTheme = {
|
||||
name = "WhiteSur-dark";
|
||||
package = pkgs.whitesur-icon-theme;
|
||||
};
|
||||
|
||||
cursorTheme = {
|
||||
name = "graphite-dark";
|
||||
package = pkgs.graphite-cursors;
|
||||
};
|
||||
|
||||
sddmTheme = {
|
||||
name = "catppuccin-sddm-corners";
|
||||
package = (pkgs.my.catppuccin-sddm-corners.override {
|
||||
config.General = {
|
||||
Background = ../../../../assets/lockscreen.png;
|
||||
Font = config.modules.desktop.fonts.fonts.sansSerif.family;
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
editor = {
|
||||
vscode = {
|
||||
colorTheme = {
|
||||
name = "Catppuccin Mocha";
|
||||
extension = (pkgs.vscode-extensions.catppuccin.catppuccin-vsc.override {
|
||||
accent = accent;
|
||||
boldKeywords = false;
|
||||
italicComments = false;
|
||||
italicKeywords = false;
|
||||
extraBordersEnabled = false;
|
||||
workbenchMode = "flat";
|
||||
bracketMode = "rainbow";
|
||||
});
|
||||
};
|
||||
iconTheme = {
|
||||
name = "material-icon-theme";
|
||||
extension = pkgs.vscode-extensions.pkief.material-icon-theme;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hyprland = "${inputs.hyprland-catppuccin}/themes/${variant}.conf";
|
||||
};
|
||||
};
|
||||
}
|
88
modules/desktop/themes/default.nix
Normal file
88
modules/desktop/themes/default.nix
Normal file
|
@ -0,0 +1,88 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.my;
|
||||
let
|
||||
cfg = config.modules.desktop.themes;
|
||||
in {
|
||||
options.modules.desktop.themes = with types; {
|
||||
active = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "Name of the theme to apply; see modules/desktop/themes for a list of valid options";
|
||||
};
|
||||
|
||||
dark = mkOpt bool false;
|
||||
|
||||
gtkTheme = {
|
||||
name = mkOpt str "";
|
||||
package = mkPackageOption pkgs "gtk" {};
|
||||
};
|
||||
iconTheme = {
|
||||
name = mkOpt str "";
|
||||
package = mkPackageOption pkgs "icon" {};
|
||||
};
|
||||
cursorTheme = {
|
||||
name = mkOpt str "";
|
||||
package = mkPackageOption pkgs "cursor" {};
|
||||
};
|
||||
sddmTheme = {
|
||||
name = mkOpt str "";
|
||||
package = mkPackageOption pkgs "sddm" {};
|
||||
};
|
||||
|
||||
editor = {
|
||||
vscode = {
|
||||
colorTheme = {
|
||||
name = mkOpt str "";
|
||||
extension = mkPackageOption pkgs "extension" {};
|
||||
};
|
||||
iconTheme = {
|
||||
name = mkOpt str "";
|
||||
extension = mkPackageOption pkgs "extension" {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hyprland = mkOpt (nullOr str) null;
|
||||
};
|
||||
|
||||
config = mkIf (cfg.active != null) {
|
||||
programs.dconf.enable = true;
|
||||
|
||||
hm.dconf = {
|
||||
enable = true;
|
||||
settings."org/gnome/desktop/interface".color-scheme = mkIf cfg.dark "prefer-dark";
|
||||
settings."org/gnome/desktop/interface".gtk-theme = cfg.gtkTheme.name;
|
||||
settings."org/gnome/desktop/interface".icon-theme = cfg.iconTheme.name;
|
||||
settings."org/gnome/desktop/interface".cursor-theme = cfg.cursorTheme.name;
|
||||
|
||||
settings."org/gnome/shell/extensions/user-theme".name = cfg.gtkTheme.name;
|
||||
};
|
||||
|
||||
hm.gtk = {
|
||||
enable = true;
|
||||
cursorTheme = cfg.cursorTheme;
|
||||
iconTheme = cfg.iconTheme;
|
||||
theme = cfg.gtkTheme;
|
||||
};
|
||||
|
||||
hm.services.dunst.iconTheme = {
|
||||
name = cfg.iconTheme.name;
|
||||
package = cfg.iconTheme.package;
|
||||
};
|
||||
|
||||
hm.programs.vscode = {
|
||||
extensions = [
|
||||
cfg.editor.vscode.colorTheme.extension
|
||||
cfg.editor.vscode.iconTheme.extension
|
||||
];
|
||||
userSettings = {
|
||||
"workbench.colorTheme" = cfg.editor.vscode.colorTheme.name;
|
||||
"workbench.iconTheme" = cfg.editor.vscode.iconTheme.name;
|
||||
};
|
||||
};
|
||||
|
||||
hm.wayland.windowManager.hyprland.settings.source = mkIf (cfg.hyprland != null) [ cfg.hyprland ];
|
||||
};
|
||||
}
|
199
modules/desktop/waybar.nix
Normal file
199
modules/desktop/waybar.nix
Normal file
|
@ -0,0 +1,199 @@
|
|||
{ lib, config, pkgs, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.waybar;
|
||||
in {
|
||||
options.modules.desktop.waybar = {
|
||||
enable = mkEnableOption "Enable Waybar, a lightweight desktop environment based on GTK+";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.wayland.windowManager.hyprland.settings.exec-once = [ "${lib.getExe pkgs.waybar}" ];
|
||||
hm.programs.waybar = {
|
||||
enable = true;
|
||||
style = builtins.concatStringsSep "\n" [
|
||||
"@import \"${inputs.waybar-catppuccin}/themes/mocha.css\";"
|
||||
(lib.readFile ../../config/waybar.css)
|
||||
];
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
#spacing = 4;
|
||||
height = 30;
|
||||
margin-top = 6;
|
||||
margin-left = 6;
|
||||
margin-right = 6;
|
||||
margin-bottom = 0;
|
||||
modules-left = [
|
||||
"hyprland/workspaces"
|
||||
"hyprland/window"
|
||||
];
|
||||
modules-center = [
|
||||
"clock"
|
||||
];
|
||||
modules-right = [
|
||||
"group/status"
|
||||
"tray"
|
||||
"group/power"
|
||||
];
|
||||
|
||||
"group/status" = {
|
||||
orientation = "inherit";
|
||||
modules = [
|
||||
"pulseaudio"
|
||||
"cpu"
|
||||
"memory"
|
||||
#"network"
|
||||
];
|
||||
};
|
||||
"group/power" = {
|
||||
orientation = "inherit";
|
||||
drawer = {
|
||||
transition-duration = 200;
|
||||
children-class = "not-power";
|
||||
transition-left-to-right = false;
|
||||
};
|
||||
modules = [
|
||||
"custom/power"
|
||||
"custom/lock"
|
||||
"custom/reboot"
|
||||
"custom/quit"
|
||||
];
|
||||
};
|
||||
"custom/quit" = {
|
||||
format = "";
|
||||
tooltip = true;
|
||||
tooltip-format = "Exit Hyprland";
|
||||
on-click = "${config.modules.desktop.hyprland.package}/bin/hyprctl dispatch exit";
|
||||
};
|
||||
"custom/lock" = {
|
||||
format = "";
|
||||
tooltip = true;
|
||||
tooltip-format = "Lock the system";
|
||||
on-click = "${lib.getExe config.modules.desktop.hyprlock.package}";
|
||||
};
|
||||
"custom/reboot" = {
|
||||
format = "↻";
|
||||
tooltip = true;
|
||||
tooltip-format = "Reboot";
|
||||
on-click = "reboot";
|
||||
};
|
||||
"custom/power" = {
|
||||
format = "⏻";
|
||||
tooltip = true;
|
||||
tooltip-format = "Power off";
|
||||
on-click = "shutdown now";
|
||||
};
|
||||
"hyprland/workspaces" = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
"1" = "";
|
||||
"2" = "";
|
||||
"3" = "";
|
||||
"4" = "";
|
||||
urgent = "";
|
||||
default = "•";
|
||||
};
|
||||
persistent-workspaces = {
|
||||
"1" = [];
|
||||
"2" = [];
|
||||
"3" = [];
|
||||
"4" = [];
|
||||
};
|
||||
};
|
||||
"hyprland/window" = {
|
||||
format = "{}";
|
||||
icon = true;
|
||||
icon-size = 16;
|
||||
rewrite = {
|
||||
"(.*) - Mozilla Firefox" = "$1";
|
||||
"(.*) - Visual Studio Code" = "$1";
|
||||
#"(.*\\.nix\\s.*)" = "";
|
||||
"(\\S+\\.js\\s.*)" = " $1";
|
||||
"(\\S+\\.ts\\s.*)" = " $1";
|
||||
"(\\S+\\.go\\s.*)" = " $1";
|
||||
"(\\S+\\.lua\\s.*)" = " $1";
|
||||
"(\\S+\\.java\\s.*)" = " $1";
|
||||
"(\\S+\\.rb\\s.*)" = " $1";
|
||||
"(\\S+\\.php\\s.*)" = " $1";
|
||||
"(\\S+\\.jsonc?\\s.*)" = " $1";
|
||||
"(\\S+\\.md\\s.*)" = " $1";
|
||||
"(\\S+\\.txt\\s.*)" = " $1";
|
||||
"(\\S+\\.cs\\s.*)" = " $1";
|
||||
"(\\S+\\.c\\s.*)" = " $1";
|
||||
"(\\S+\\.cpp\\s.*)" = " $1";
|
||||
"(\\S+\\.hs\\s.*)" = " $1";
|
||||
".*Discord | (.*) | .*" = "$1 - ArmCord";
|
||||
#"(.*) - ArmCord" = "$1";
|
||||
};
|
||||
separate-outputs = true;
|
||||
};
|
||||
pulseaudio = {
|
||||
format = "{icon} {volume}%";
|
||||
format-bluetooth = "{icon} {volume}%";
|
||||
format-muted = "婢 {volume}%";
|
||||
format-icons = {
|
||||
headphone = "";
|
||||
hands-free = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = ["" "" ""];
|
||||
};
|
||||
scroll-step = 1;
|
||||
on-click = "${lib.getExe pkgs.pavucontrol}";
|
||||
ignored-sinks = ["Easy Effects Sink"];
|
||||
};
|
||||
cpu = {
|
||||
interval = 4;
|
||||
format = " {usage}%";
|
||||
};
|
||||
memory = {
|
||||
interval = 4;
|
||||
format = " {percentage}%";
|
||||
tooltip-format = "{used:0.1f}GiB/{avail:0.1f}GiB used\n{swapUsed:0.1f}GiB/{swapAvail:0.1f}GiB swap";
|
||||
};
|
||||
"network" = {
|
||||
format = "";
|
||||
format-ethernet = "";
|
||||
format-wifi = " {signalStrength}%";
|
||||
format-disconnected = "";
|
||||
tooltip-format = "{ifname} via {gwaddr}";
|
||||
tooltip-format-wifi = "connected to {essid}";
|
||||
tooltip-format-ethernet = "{ifname}";
|
||||
tooltip-format-disconnected = "Disconnected";
|
||||
};
|
||||
"clock" = {
|
||||
format = "{:%H:%M}";
|
||||
format-alt = "{:%a %b %d %R}";
|
||||
tooltip-format = "<tt><small>{calendar}</small></tt>";
|
||||
calendar = {
|
||||
mode = "year";
|
||||
mode-mon-col = 3;
|
||||
weeks-pos = "right";
|
||||
on-scroll = 1;
|
||||
on-click-right = "mode";
|
||||
format = {
|
||||
months = "<span color='#ffead3'><b>{}</b></span>";
|
||||
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
|
||||
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
|
||||
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
|
||||
};
|
||||
actions = {
|
||||
on-click-right = "mode";
|
||||
on-click-forward = "tz_up";
|
||||
on-click-backward = "tz_down";
|
||||
on-scroll-up = "shift_up";
|
||||
on-scroll-down = "shift_down";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue