snowflake/modules/hyprland/default.nix

103 lines
2.5 KiB
Nix
Raw Normal View History

2022-12-14 19:26:48 -05:00
{ config, pkgs, lib, inputs, ... }:
2022-12-06 18:13:43 -05:00
let
dbus-hyprland-environment = pkgs.writeTextFile {
name = "dbus-hyprland-environment";
destination = "/bin/dbus-hyprland-environment";
executable = true;
text = ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=hyprland
2022-12-15 22:34:31 -05:00
systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr xdg-desktop-portal-kde
systemctl --user start pipewire wireplumber pipewire-media-session xdg-desktop-portal xdg-desktop-portal-hyprland
2022-12-06 18:13:43 -05:00
'';
};
configure-gtk = pkgs.writeTextFile {
name = "configure-gtk";
destination = "/bin/configure-gtk";
executable = true;
text = let
schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gesettings/schemas/${schema.name}";
in ''
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
gnome_schema=org.gnome.desktop.interface
2022-12-14 19:26:48 -05:00
gesettings set $gnome_schema gtk-theme 'Catppuccin-Mocha-Pink-Dark'
2022-12-06 18:13:43 -05:00
'';
};
flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz";
hyprland = (import flake-compat {
src = builtins.fetchTarball "https://github.com/vaxerski/Hyprland/archive/master.tar.gz";
}).defaultNix;
in
{
environment.systemPackages = with pkgs; [
dbus-hyprland-environment
configure-gtk
wayland
glib
gnome3.adwaita-icon-theme
grim
2022-12-06 21:36:50 -05:00
slurp
2022-12-06 18:13:43 -05:00
wl-clipboard
2022-12-16 15:53:00 -05:00
wlogout
2022-12-06 18:13:43 -05:00
wlr-randr
2022-12-12 00:34:25 -05:00
rofi-wayland
2022-12-06 18:13:43 -05:00
];
services.dbus.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
2022-12-15 22:34:31 -05:00
extraPortals = with pkgs; [
2022-12-16 02:50:30 -05:00
2022-12-14 19:26:48 -05:00
];
2022-12-16 02:50:30 -05:00
2022-12-06 18:13:43 -05:00
};
programs.hyprland.enable = true;
programs.xwayland.enable = true;
environment.sessionVariables = rec {
GBM_BACKEND = "nvidia-drm";
__GL_GSYNC_ALLOWED = "0";
__GL_VRR_ALLOWED = "0";
WLR_DRM_NO_ATOMIC = "1";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
# Will break SDDM if running X11
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
GDK_BACKEND = "wayland";
WLR_NO_HARDWARE_CURSORS = "1";
MOZ_ENABLE_WAYLAND = "1";
2022-12-12 00:34:25 -05:00
PATH = [
2022-12-12 02:46:51 -05:00
"$HOME/bin/:$PATH"
2022-12-12 00:34:25 -05:00
];
2022-12-15 22:34:31 -05:00
GTK_THEME = "Catppuccin-Pink-Dark";
2022-12-12 02:46:51 -05:00
2022-12-06 18:13:43 -05:00
};
services.greetd = {
enable = true;
settings = rec {
initial_session = {
command = "Hyprland";
user = "notoh";
};
default_session = initial_session;
};
};
environment.etc."greetd/environments".text = ''
Hyprland
'';
}