feat(greetd): use hyprland instead of sway

This commit is contained in:
matt1432 2023-10-19 19:36:47 -04:00
parent 50da06accf
commit c37d0c057b
4 changed files with 90 additions and 41 deletions

View file

@ -3,6 +3,7 @@
{
imports = [
./dracula-theme.nix
./regreet.nix
];
nixpkgs.overlays = [

View file

@ -0,0 +1,20 @@
{ pkgs, ... }: {
programs.regreet = {
package = pkgs.greetd.regreet.overrideAttrs (self: super: rec {
version = "0.1.1-patched";
src = pkgs.fetchFromGitHub {
owner = "rharish101";
repo = "ReGreet";
rev = "61d871a0ee5c74230dfef8100d0c9bc75b309203";
hash = "sha256-PkQTubSm/FN3FXs9vBB3FI4dXbQhv/7fS1rXkVsTAAs=";
};
cargoDeps = super.cargoDeps.overrideAttrs (_: {
inherit src;
outputHash = "sha256-dR6veXCGVMr5TbCvP0EqyQKTG2XM65VHF9U2nRWyzfA=";
});
# temp fix until https://github.com/rharish101/ReGreet/issues/32 is solved
patches = [./patches/regreet.patch];
});
};
}

View file

@ -1,55 +1,85 @@
{ lib
, pkgs
, config
, hyprland
, ...
}: let
sway = "${config.programs.sway.package}/bin/sway";
swayConf = pkgs.writeText "greetd-sway-config" ''
exec "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP"
input "type:touchpad" {
tap enabled
regreetBin = "${lib.getExe config.programs.regreet.package}";
hyprBin = "${hyprland.packages.x86_64-linux.default}/bin";
gset = pkgs.gsettings-desktop-schemas;
css = pkgs.writeText "style.css" ''
window {
background-color: rgba(0, 0, 0, 0);
}
seat seat0 xcursor_theme Dracula-cursors 24
xwayland disable
'';
default_border none
default_floating_border none
font pango:monospace 0
titlebar_padding 1
titlebar_border_thickness 0
paperConf = pkgs.writeText "hyprpaper.conf" ''
preload = ${pkgs.dracula-theme}/wallpapers/waves.png
wallpaper = eDP-1, ${pkgs.dracula-theme}/wallpapers/waves.png
'';
exec "${lib.getExe config.programs.regreet.package} -l debug; swaymsg exit"
hyprConf = pkgs.writeText "greetd-hypr-config" ''
exec-once = hyprpaper --config ${paperConf}
input {
kb_layout = ca
kb_variant = multix
kb_model =
kb_options =
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = yes
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
env = XCURSOR_SIZE,24
exec-once=hyprctl setcursor Dracula-cursors 24
misc {
disable_hyprland_logo = true
disable_splash_rendering = true
vfr = true
}
general {
border_size = 0
}
decoration {
blur {
enabled = false
}
drop_shadow = false
}
# FIXME: kb doesn't work
env = XDG_DATA_DIRS, ${gset}/share/gsettings-schemas/${gset.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS
exec-once = squeekboard
exec-once = gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true
exec-once = ${regreetBin} -s ${css}; ${hyprBin}/hyprctl dispatch exit
'';
in {
environment.systemPackages = with pkgs; [
dracula-theme
flat-remix-icon-theme
];
users.users.greeter = {
packages = with pkgs; [
dracula-theme
flat-remix-icon-theme
hyprpaper
gtk3
glib
squeekboard
];
};
# See overlay
programs.regreet = {
enable = true;
package = pkgs.greetd.regreet.overrideAttrs (self: super: rec {
version = "0.1.1-patched";
src = pkgs.fetchFromGitHub {
owner = "rharish101";
repo = "ReGreet";
rev = "61d871a0ee5c74230dfef8100d0c9bc75b309203";
hash = "sha256-PkQTubSm/FN3FXs9vBB3FI4dXbQhv/7fS1rXkVsTAAs=";
};
cargoDeps = super.cargoDeps.overrideAttrs (_: {
inherit src;
outputHash = "sha256-dR6veXCGVMr5TbCvP0EqyQKTG2XM65VHF9U2nRWyzfA=";
});
# temp fix until https://github.com/rharish101/ReGreet/issues/32 is solved
patches = [./regreet.patch];
});
settings = {
background = {
path = "${pkgs.dracula-theme}/wallpapers/waves.png";
fit = "Cover";
};
GTK = {
cursor_theme_name = "Dracula-cursors";
font_name = "Sans Serif";
@ -59,13 +89,11 @@ in {
};
};
programs.sway.enable = true;
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${sway} --config ${swayConf}";
command = "${hyprBin}/Hyprland --config ${hyprConf}";
user = "greeter";
};
};