!qol(restructure): heavy restructure
This commit is contained in:
4
modules/hyprland/default.nix
Normal file
4
modules/hyprland/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
_: {
|
||||
home = ./home.nix;
|
||||
nixos = ./nixos.nix;
|
||||
}
|
||||
104
modules/hyprland/home.nix
Normal file
104
modules/hyprland/home.nix
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.modules.Hyprland;
|
||||
suspend = pkgs.writeShellScript "hyprland_suspend" ''
|
||||
#!/bin/bash
|
||||
|
||||
case "$1" in
|
||||
suspend)
|
||||
killall -STOP Hyprland
|
||||
;;
|
||||
resume)
|
||||
killall -CONT Hyprland
|
||||
;;
|
||||
esac
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./settings.nix
|
||||
./runner.nix
|
||||
./screenshot.nix
|
||||
];
|
||||
options.modules.Hyprland = {
|
||||
enable = lib.mkEnableOption "Hyprland";
|
||||
};
|
||||
# TODO, split this into its own module;
|
||||
config = lib.mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
# set the flake package
|
||||
# settings = { };
|
||||
systemd.variables = [ "--all" ];
|
||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||
portalPackage =
|
||||
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||
};
|
||||
programs = {
|
||||
wlogout = {
|
||||
enable = true;
|
||||
};
|
||||
foot = {
|
||||
enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
term = "xterm-256color";
|
||||
|
||||
font = "CaskaydiaCove Nerd Font Mono:size=12";
|
||||
};
|
||||
|
||||
mouse = {
|
||||
hide-when-typing = "yes";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
systemd.user.services."hyprland_suspend" = {
|
||||
Unit = {
|
||||
Description = "Suspend hyprland";
|
||||
Before = [
|
||||
"systemd-suspend.service"
|
||||
"systemd-hibernate.service"
|
||||
"nvidia-suspend.service"
|
||||
"nvidia-hibernate.service"
|
||||
];
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [
|
||||
"systemd-suspend.service"
|
||||
"systemd-hibernate.service"
|
||||
];
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${suspend} suspend";
|
||||
};
|
||||
};
|
||||
systemd.user.services."hyprland_resume" = {
|
||||
Unit = {
|
||||
Description = "Resume hyprland";
|
||||
After = [
|
||||
"systemd-suspend.service"
|
||||
"systemd-hibernate.service"
|
||||
"nvidia-resume.service"
|
||||
];
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [
|
||||
"systemd-suspend.service"
|
||||
"systemd-hibernate.service"
|
||||
];
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${suspend} resume";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
48
modules/hyprland/nixos.nix
Normal file
48
modules/hyprland/nixos.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.modules.Hyprland;
|
||||
in
|
||||
{
|
||||
options.modules.Hyprland = {
|
||||
enable = lib.mkEnableOption "Hyprland";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.xwayland.enable = true;
|
||||
boot.kernelParams = [
|
||||
"resume=UUID=d9b81619-5772-4ac4-bcd5-552e1e784f9e"
|
||||
"resume_offset=141042944"
|
||||
];
|
||||
boot.resumeDevice = "/dev/disk/by-uuid/d9b81619-5772-4ac4-bcd5-552e1e784f9e";
|
||||
powerManagement.enable = true;
|
||||
swapDevices = [
|
||||
# [[ Hibernate ]]
|
||||
{
|
||||
device = "/var/lib/swapfile";
|
||||
size = 48 * 1024; # 48GB in MB
|
||||
}
|
||||
];
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
# set the flake package
|
||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||
# make sure to also set the portal package, so that they are in sync
|
||||
portalPackage =
|
||||
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||
};
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
|
||||
};
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
nix.settings = {
|
||||
substituters = [ "https://hyprland.cachix.org" ];
|
||||
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
16
modules/hyprland/runner.nix
Normal file
16
modules/hyprland/runner.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
pkgs.walker
|
||||
];
|
||||
systemd.user.services.walker-deamon = {
|
||||
Install = {
|
||||
WantedBy = [ "hyprland-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.writeShellScript "watch-store" ''
|
||||
walker --gapplication-service
|
||||
''}";
|
||||
};
|
||||
};
|
||||
}
|
||||
12
modules/hyprland/screenshot.nix
Normal file
12
modules/hyprland/screenshot.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ inputs, pkgs, ... }:
|
||||
let
|
||||
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
wl-clipboard
|
||||
wayfreeze
|
||||
grim
|
||||
slurp
|
||||
];
|
||||
}
|
||||
163
modules/hyprland/settings.nix
Normal file
163
modules/hyprland/settings.nix
Normal file
@@ -0,0 +1,163 @@
|
||||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
pkgs.hyprcursor
|
||||
pkgs.rose-pine-cursor
|
||||
];
|
||||
home.pointerCursor = {
|
||||
enable = true;
|
||||
name = "rose-pine-hyprcursor";
|
||||
package = pkgs.rose-pine-hyprcursor;
|
||||
hyprcursor.enable = true;
|
||||
};
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
monitor = [
|
||||
"HDMI-A-1, 1920x1080@60, 0x0, 1"
|
||||
"DP-3, 1920x1080@144, 1920x0, 1"
|
||||
];
|
||||
exec-once = [
|
||||
"hyprctl dispatch workspace 2" # shit solution to get quickshell on the right monitor
|
||||
];
|
||||
env = [
|
||||
"XCURSOR_THEME,BreezeX-RosePine-Linux"
|
||||
"XCURSOR_SIZE,24"
|
||||
"HYPRCURSOR_SIZE,24"
|
||||
"LIBVA_DRIVER_NAME,nvidia"
|
||||
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
|
||||
"WEBKIT_DISABLE_DMABUF_RENDERER,1" # maybe disable if nixos fixes alcom
|
||||
];
|
||||
general = {
|
||||
gaps_in = 1;
|
||||
gaps_out = 1;
|
||||
border_size = 1;
|
||||
# col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
|
||||
# col.inactive_border = rgba(595959aa)
|
||||
resize_on_border = false;
|
||||
allow_tearing = true;
|
||||
layout = "dwindle";
|
||||
};
|
||||
decoration = {
|
||||
rounding = 0;
|
||||
rounding_power = 1;
|
||||
active_opacity = 1.0;
|
||||
inactive_opacity = 1.0;
|
||||
|
||||
shadow = {
|
||||
enabled = false;
|
||||
};
|
||||
|
||||
blur = {
|
||||
enabled = false;
|
||||
};
|
||||
};
|
||||
animations = {
|
||||
enabled = true;
|
||||
bezier = [
|
||||
"easeOutQuint,0.23,1,0.32,1"
|
||||
"easeInOutCubic,0.65,0.05,0.36,1"
|
||||
"linear,0,0,1,1"
|
||||
"almostLinear,0.5,0.5,0.75,1.0"
|
||||
"quick,0.15,0,0.1,1"
|
||||
];
|
||||
animation = [
|
||||
"global, 1, 10, default"
|
||||
"border, 1, 5.39, easeOutQuint"
|
||||
"windows, 1, 2.79, easeOutQuint"
|
||||
"windowsIn, 1, 1.1, easeOutQuint, popin 87%"
|
||||
"windowsOut, 1, 1.49, linear, popin 87%"
|
||||
"fadeIn, 1, 1.73, almostLinear"
|
||||
"fadeOut, 1, 1.46, almostLinear"
|
||||
"fade, 1, 2.03, quick"
|
||||
"layers, 1, 3.81, easeOutQuint"
|
||||
"layersIn, 1, 4, easeOutQuint, fade"
|
||||
"layersOut, 1, 1.5, linear, fade"
|
||||
"fadeLayersIn, 1, 1.79, almostLinear"
|
||||
"fadeLayersOut, 1, 1.39, almostLinear"
|
||||
"workspaces, 1, 1.94, almostLinear, fade"
|
||||
"workspacesIn, 1, 1.21, almostLinear, fade"
|
||||
"workspacesOut, 1, 1.94, almostLinear, fade"
|
||||
"zoomFactor, 1, 7, quick"
|
||||
];
|
||||
};
|
||||
dwindle = {
|
||||
pseudotile = true;
|
||||
preserve_split = true;
|
||||
};
|
||||
# master = {
|
||||
# new_status = master;
|
||||
# };
|
||||
misc = {
|
||||
force_default_wallpaper = -1;
|
||||
disable_hyprland_logo = false;
|
||||
enable_anr_dialog = false;
|
||||
vfr = true;
|
||||
};
|
||||
input = {
|
||||
kb_layout = "gb";
|
||||
follow_mouse = 2;
|
||||
sensitivity = -0.5;
|
||||
};
|
||||
"$mainMod" = "SUPER";
|
||||
bind = [
|
||||
"$mainMod, Q, exec, foot"
|
||||
"$mainMod, C, killactive"
|
||||
"$mainMod, M, exit"
|
||||
"$mainMod, E, exec, $fileManager"
|
||||
"$mainMod, V, togglefloating,"
|
||||
"$mainMod, R, exec, walker"
|
||||
"$mainMod, P, pseudo, # dwindle"
|
||||
"$mainMod, J, togglesplit, # dwindle"
|
||||
"$mainMod, left, movefocus, l"
|
||||
"$mainMod, right, movefocus, r"
|
||||
"$mainMod, up, movefocus, u"
|
||||
"$mainMod, down, movefocus, d"
|
||||
"$mainMod, L, exec, wlogout"
|
||||
(
|
||||
"$mainMod, S, exec, "
|
||||
+ ''wayfreeze --after-freeze-cmd 'grim -g "$(slurp -d)" - | wl-copy -t image/png;killall wayfreeze' --hide-cursor''
|
||||
)
|
||||
"$mainMod, F, fullscreen"
|
||||
"$mainMod, mouse_down, workspace, e+1"
|
||||
"$mainMod, mouse_up, workspace, e-1"
|
||||
", home, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
", end, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
", F8, pass, class:^(com\.obsproject\.Studio)$"
|
||||
"$mainMod, 0, workspace, 10"
|
||||
"$mainMod SHIFT, 0, movetoworkspace, 10"
|
||||
]
|
||||
++ (builtins.concatLists (
|
||||
builtins.genList (
|
||||
i:
|
||||
let
|
||||
ws = i + 1;
|
||||
in
|
||||
[
|
||||
"$mainMod, ${toString ws}, workspace, ${toString ws}"
|
||||
"$mainMod SHIFT, ${toString ws}, movetoworkspace, ${toString ws}"
|
||||
]
|
||||
) 9
|
||||
));
|
||||
bindm = [
|
||||
"$mainMod, mouse:272, movewindow"
|
||||
"$mainMod, mouse:273, resizewindow"
|
||||
];
|
||||
workspace = [
|
||||
"name:2, monitor:DP-3"
|
||||
];
|
||||
windowrule = [
|
||||
"match:class .*, suppress_event maximize"
|
||||
"match:class ^(gamescope)$, workspace 5"
|
||||
"match:class ^(gamescope)$, fullscreen true"
|
||||
"match:class ^(gamescope)$, immediate true"
|
||||
"match:class ^(steam)$, workspace 6 silent"
|
||||
"match:class ^(vesktop)$, workspace 8 silent"
|
||||
"match:class ^(org.telegram.desktop)$, workspace 8 silent"
|
||||
"match:class ^(com.obsproject.Studio)$, workspace 10 silent"
|
||||
"match:initial_title ^(OBS Studio Crash Detected)$, pin true"
|
||||
"match:initial_title ^(Discord Popout)$, workspace 1 silent"
|
||||
];
|
||||
# exec-once = [
|
||||
# ];
|
||||
# we need to auto launch: quickshell, steam, ar_rpc (maybe), vesktop, telegram, qbit, and obs
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user