Initial experimental commit

This commit is contained in:
ooks-io 2024-01-13 22:52:45 +13:00
parent b848f9d893
commit 682a19b13c
146 changed files with 2463 additions and 2389 deletions

View file

@ -0,0 +1,15 @@
{ lib, config, ... }:
{
imports = [
#./eww
#./ags -- needs to be implemented
#./waybar -- needs to be implemented
];
options.programs.desktop.wayland.bar = {
eww = {
enable = lib.mkEnableOption "Enable Eww bar";
};
};
}

View file

@ -0,0 +1,17 @@
{ lib, ... }:
{
imports = [
./bar
./lockscreen
./notification
./utility
./windowManager
# ./launcher
];
options.programs.desktop.wayland = {
base = {
enable = lib.mkEnableOption "Enable wayland specific utilities";
};
};
}

View file

@ -0,0 +1,15 @@
{ lib, ... }:
{
imports = [
#./gtkLock --- still needs to be implemented
./swaylock
];
options.programs.desktop.wayland.lockscreen = {
swaylock = {
enable = lib.mkEnableOption "Enable Swaylock screen";
};
};
}

View file

@ -0,0 +1,35 @@
{ config, lib, ... }:
let
inherit (config.colorscheme) colors;
cfg = config.programs.desktop.wayland.lockscreen.swaylock;
in
{
config = {
programs.swaylock = lib.mkIf cfg.enable {
enable = true;
settings = {
font = config.fontProfiles.monospace.family;
color = "#${colors.base01}";
ring-color = "#${colors.base02}";
inside-wrong-color = "#${colors.base08}";
ring-wrong-color = "#${colors.base08}";
key-hl-color = "#${colors.base0B}";
bs-hl-color = "#${colors.base08}";
ring-ver-color = "#${colors.base09}";
inside-ver-color = "#${colors.base09}";
inside-color = "#${colors.base01}";
text-color = "#${colors.base07}";
text-clear-color = "#${colors.base01}";
text-ver-color = "#${colors.base01}";
text-wrong-color = "#${colors.base01}";
text-caps-lock-color = "#${colors.base07}";
inside-clear-color = "#${colors.base0C}";
ring-clear-color = "#${colors.base0C}";
inside-caps-lock-color = "#${colors.base09}";
ring-caps-lock-color = "#${colors.base02}";
separator-color = "#${colors.base02}";
};
};
};
}

View file

@ -0,0 +1,14 @@
{ lib, ... }:
{
imports = [
./mako
#./dunst -- still needs to be implemented
];
options.programs.desktop.wayland.notification = {
mako = {
enable = lib.mkEnableOption "Enable mako notification daemon";
};
};
}

View file

@ -0,0 +1,38 @@
{ config, lib, ... }:
let
inherit (config.colorscheme) colors kind;
cfg = config.programs.desktop.wayland.notification.mako;
in {
config = {
services.mako = lib.mkIf cfg.enable {
enable = true;
iconPath =
if kind == "dark" then
"${config.gtk.iconTheme.package}/share/icons/Papirus-Dark"
else
"${config.gtk.iconTheme.package}/share/icons/Papirus-Light";
font = "${config.fontProfiles.regular.family} 12";
padding = "10,10";
anchor = "top-right";
width = 300;
height = 100;
borderSize = 2;
defaultTimeout = 3000;
backgroundColor = "#${colors.base00}dd";
borderColor = "#${colors.base05}dd";
textColor = "#${colors.base05}dd";
extraConfig = ''
[app-name="system-notify"]
padding=3,3
width=100
height=100
[app-name="bat-notify"]
padding=3,3
width=100
height=100
anchor=top-center
'';
};
};
}

View file

@ -0,0 +1,50 @@
{ lib, config, pkgs, ... }:
let
cfg = config.programs.desktop.wayland.base;
in
{
config = lib.mkIf cfg.enable {
home = {
packages = with pkgs; [
grim
gtk3
libnotify
waypipe
pulseaudio
pamixer
slurp
wf-recorder
wl-clipboard
wl-mirror
xdg-utils
wlr-randr
];
sessionVariables = {
QT_QPA_PLATFORM = "wayland";
SDL_VIDEODRIVER = "wayland";
XDG_SESSION_TYPE = "wayland";
};
};
systemd.user.targets.tray = {
Unit = {
Description = "Home Manager System Tray";
Requires = ["graphical-session-pre.target"];
};
};
services.gammastep = {
enable = true;
provider = "geoclue2";
temperature = {
day = 6000;
night = 4600;
};
settings = {
general.adjustment-method = "wayland";
};
};
};
}

View file

@ -0,0 +1,14 @@
{ lib, ... }:
{
imports = [
./hyprland
];
options.programs.desktop.wayland.windowManager = {
hyprland = {
enable = lib.mkEnableOption "Enable Hyprland window-manager";
};
};
}

View file

@ -0,0 +1,65 @@
{ config, lib, ... }:
let
cfg = config.programs.desktop.wayland.windowManager.hyprland;
in
{
config = {
wayland.windowManager.hyprland = lib.mkIf cfg.enable {
settings = {
general = {
gaps_in = 10;
gaps_out = 10;
border_size = 2;
cursor_inactive_timeout = 4;
"col.active_border" = "0xff${config.colorscheme.colors.base05}";
"col.inactive_border" = "0xff${config.colorscheme.colors.base02}";
};
group = {
"col.border_active" = "0xff${config.colorscheme.colors.base0B}";
"col.border_inactive" = "0xff${config.colorscheme.colors.base04}";
};
dwindle.split_width_multiplier = 1.35;
decoration = {
active_opacity = 1.0;
inactive_opacity = 1.0;
fullscreen_opacity = 1.0;
rounding = 0;
blur = {
enabled = false;
new_optimizations = true;
ignore_opacity = true;
};
drop_shadow = true;
shadow_range = 12;
shadow_offset = "3 3";
"col.shadow" = "0x44000000";
"col.shadow_inactive" = "0x66000000";
};
animations = {
enabled = true;
bezier = [
"easein,0.11, 0, 0.5, 0"
"easeout,0.5, 1, 0.89, 1"
"easeinback,0.36, 0, 0.66, -0.56"
"easeoutback,0.34, 1.56, 0.64, 1"
];
animation = [
"windowsIn,1,3,easeoutback,slide"
"windowsOut,1,3,easeinback,slide"
"windowsMove,1,3,easeoutback"
"workspaces,1,2,easeoutback,slide"
"fadeIn,1,3,easeout"
"fadeOut,1,3,easein"
"fadeSwitch,1,3,easeout"
"fadeShadow,1,3,easeout"
"fadeDim,1,3,easeout"
"border,1,3,easeout"
];
};
};
};
};
}

View file

@ -0,0 +1,159 @@
{ lib, config, pkgs, ... }:
let
cfg = config.programs.desktop.wayland.windowManager.hyprland;
light = "${pkgs.light}/bin/light";
notifysend = "${pkgs.libnotify}/bin/notify-send";
#pamixer = "${pkgs.pamixer}/bin/pamixer";
brightnessScript = pkgs.writeShellScriptBin "brightness" ''
#!/bin/sh
if [ "$1" == "up" ]; then
${light} -A 10
elif [ "$1" == "down" ]; then
${light} -U 10
else
echo "Invalid argument"
exit 1
fi
BRIGHTNESS=$(${light} -G | awk -F'.' '{print$1}')
${notifysend} --app-name="system-notify" -h string:x-canonical-private-synchronous:sys-notify "󰃠 $BRIGHTNESS%"
'';
volumeScript = pkgs.writeShellScriptBin "volume" ''
#!/bin/sh
if [ "$1" == "up" ]; then
pamixer --increase 5
elif [ "$1" == "down" ]; then
pamixer --decrease 5
elif [ "$1" == "mute" ]; then
pamixer --toggle-mute
fi
VOLUME=$(pamixer --get-volume-human)
${notifysend} --app-name="system-notify" -h string:x-canonical-private-synchronous:sys-notify " $VOLUME"
'';
in
{
wayland.windowManager.hyprland.settings = lib.mkIf cfg.enable {
bind = let
terminal = config.home.sessionVariables.TERMINAL;
browser = config.home.sessionVariables.BROWSER;
editor = config.home.sessionVariables.EDITOR;
bright = "${brightnessScript}/bin/brightness";
volume = "${volumeScript}/bin/volume";
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
spotify = "${terminal} -e spotify_player";
spotifyctl = "${pkgs.spotify-player}/bin/spotify_player";
#makoctl = "${config.services.mako.package}/bin/makoctl";
password = "${pkgs._1password-gui}/bin/1password --enable-features=UseOzonePlatform --ozone-platform=wayland";
#playerctl = "${config.services.playerctld.package}/bin/playerctl";
#playerctld = "${config.services.playerctld.package}/bin/playerctld";
#pactl = "${pkgs.pulseaudio}/bin/pactl";
in [
# Program Launch
"SUPER, b, exec, ${browser}"
"SUPER, return, exec, ${terminal}"
"SUPER, e, exec, ${editor}"
"SUPER, m, exec, ${spotify}"
"SUPERSHIFT, P, exec, ${password}"
# Spotify PLayer Controls
"SUPER, bracketright, exec, ${spotifyctl} playback next"
"SUPER, bracketleft, exec, ${spotifyctl} playback previous"
"SUPER, backslash, exec, ${spotifyctl} playback play-pause"
# Brightness
",XF86MonBrightnessUp, exec, ${bright} up"
",XF86MonBrightnessDown, exec, ${bright} down"
# Volume
",XF86AudioRaiseVolume, exec, ${volume} up"
",XF86AudioLowerVolume, exec, ${volume} down"
",XF86AudioMute, exec, ${volume} mute"
# Window Management
"SUPER, Q, killactive"
"SUPER CTRL, backspace, killactive"
"SUPERSHIFT ALT, delete, exit"
"SUPER, F, fullscreen"
"SUPER, Space, togglefloating"
"SUPER, P, pseudo" # dwindle
"SUPER, S, togglesplit" # dwindle
# Focus
"SUPER, left, movefocus,l"
"SUPER, right, movefocus,r"
"SUPER, up, movefocus,u"
"SUPER, down, movefocus,d"
# Move
"SUPERSHIFT, left, movewindow,l"
"SUPERSHIFT, right, movewindow,r"
"SUPERSHIFT, up, movewindow,u"
"SUPERSHIFT, down, movewindow,d"
#Resize
"SUPER CTRL, left, resizeactive,-20 0"
"SUPERCTRL, right, resizeactive,20 0"
"SUPER CTRL, up, resizeactive,0 -20"
"SUPERCTRL, down, resizeactive,0 20"
# Switch workspace
"SUPER, 1, workspace,1"
"SUPER, 2, workspace,2"
"SUPER, 3, workspace,3"
"SUPER, 4, workspace,4"
"SUPER, 5, workspace,5"
"SUPER, 6, workspace,6"
"SUPER, 7, workspace,7"
"SUPER, 8, workspace,8"
"SUPER, 9, workspace,9"
"SUPER, 0, workspace,10"
"SUPER, comma, workspace,e+1"
"SUPER, period, workspace,e-1"
"SUPER, tab, focusCurrentOrLast"
# Move workspace
"SUPERSHIFT, 1, movetoworkspace,1"
"SUPERSHIFT, 2, movetoworkspace,2"
"SUPERSHIFT, 3, movetoworkspace,3"
"SUPERSHIFT, 4, movetoworkspace,4"
"SUPERSHIFT, 5, movetoworkspace,5"
"SUPERSHIFT, 6, movetoworkspace,6"
"SUPERSHIFT, 7, movetoworkspace,7"
"SUPERSHIFT, 8, movetoworkspace,8"
"SUPERSHIFT, 9, movetoworkspace,9"
"SUPERSHIFT, 0, movetoworkspace,10"
# Lock Screen
"SUPER, Backspace, exec, ${swaylock}"
];
# Mouse
bindm = [
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
];
};
}

View file

@ -0,0 +1,64 @@
{ lib, config, pkgs, ... }:
let
cfg = config.programs.desktop.wayland.windowManager.hyprland;
in
{
imports = [
./binds.nix #hyprland keybindings
./appearance.nix
./rules.nix
./exec.nix
];
config = lib.mkIf cfg.enable {
xdg.portal = {
extraPortals = [ pkgs.inputs.hyprland.xdg-desktop-portal-hyprland ];
configPackages = [ pkgs.inputs.hyprland.hyprland ];
};
home.packages = with pkgs; [
inputs.hyprwm-contrib.grimblast
hyprpicker
];
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.inputs.hyprland.hyprland;
systemd = {
enable = true;
extraCommands = lib.mkBefore [
"systemctl --user stop graphical-session.target"
"systemctl --user start hyprland-session.target"
];
};
settings = {
input = {
kb_layout = "us";
touchpad = {
disable_while_typing = false;
scroll.factor = 0.1;
};
};
misc = {
vrr = true;
disable_hyprland_logo = true;
force_default_wallpaper = 0;
};
gestures = {
workspace_swipe = true;
workspace_swipe_forever = true;
};
monitor = lib.concatMap (m: let
resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}";
position = "${toString m.x}x${toString m.y}";
basicConfig = "${m.name},${if m.enabled then "${resolution},${position},1" else "disable"}";
in
[ basicConfig ] ++ (if m.transform != 0 then ["${m.name},transform,${toString m.transform}"] else [])
) (config.monitors);
};
};
};
}

View file

@ -0,0 +1,38 @@
{ config, lib, ... }:
{
home = lib.mkIf config.programs.desktop.wayland.windowManager.hyprland.enable {
sessionVariables = {
# GTK_IM_MODULE = "fcitx5";
# QT_IM_MODULE = "fcitx5";
# XMODIFIERS = "@im=fcitx5";
#QT_QPA_PLATFORMTHEME = "gtk3";
QT_SCALE_FACTOR = "1";
#MOZ_ENABLE_WAYLAND = "1";
SDL_VIDEODRIVER = "wayland";
_JAVA_AWT_WM_NONREPARENTING = "1";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
WLR_DRM_DEVICES = "/dev/dri/card1:/dev/dri/card0";
WLR_NO_HARDWARE_CURSORS = "1"; # if no cursor,uncomment this line
WLR_RENDERER_ALLOW_SOFTWARE = "1";
NIXOS_OZONE_WL = "1";
# GBM_BACKEND = "nvidia-drm";
CLUTTER_BACKEND = "wayland";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
LIBVA_DRIVER_NAME = "nvidia";
WLR_RENDERER = "vulkan";
# __NV_PRIME_RENDER_OFFLOAD = "1";
XCURSOR_SIZE = "24";
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
XDG_CACHE_HOME = "\${HOME}/.cache";
XDG_CONFIG_HOME = "\${HOME}/.config";
XDG_BIN_HOME = "\${HOME}/.local/bin";
XDG_DATA_HOME = "\${HOME}/.local/share";
};
};
}

View file

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
let
cfg = config.programs.desktop.wayland.windowManager.hyprland;
in
{
config = {
wayland.windowManager.hyprland.settings = lib.mkIf cfg.enable {
exec = [
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
"${pkgs.swaybg}/bin/swaybg -i ~/.dotfiles/nix/walls/gruvbox/gruvbox-blank.png --mode fill"
];
exec-once = [
"${pkgs._1password-gui}/bin/1password --silent"
"${pkgs.live-buds-cli}/bin/earbuds -d"
"eww daemon && eww open bar"
];
};
};
}

View file

@ -0,0 +1,20 @@
{ lib, config, ... }:
let
cfg = config.programs.desktop.wayland.windowManager.hyprland;
in
{
config = {
wayland.windowManager.hyprland.settings = lib.mkIf cfg.enable {
windowrulev2 = [
"float,move 191 15,size 924 396,class:(1Password)"
"float, title:^(Picture-in-Picture)$"
"pin, title:^(Picture-in-Picture)$"
"rounding 0, xwayland:1"
"center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$"
"size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$"
];
};
};
}