move overrides to overlay.nix

This commit is contained in:
Kopatz
2024-05-20 12:27:28 +02:00
parent effdbf8ac5
commit e9c3f0871c
8 changed files with 350 additions and 368 deletions

View File

@@ -1,85 +1,81 @@
{config, pkgs, lib, inputs, ... }:
{ config, pkgs, lib, inputs, ... }:
with lib;
let
cfg = config.custom.graphical.hyprland;
in
{
let cfg = config.custom.graphical.hyprland;
in {
options.custom.graphical.hyprland = {
enable = mkEnableOption "Enables hyprland";
enable = mkEnableOption "Enables hyprland";
};
options.custom.graphical.hyprland.videobridge = {
enable = mkEnableOption "Enables xwaylandvideobridge for hyprland";
enable = mkEnableOption "Enables xwaylandvideobridge for hyprland";
};
config = let
patchedWaybar = pkgs.unstable.waybar.overrideAttrs (oldAttrs: { mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; });
in mkIf cfg.enable {
services.xserver = {
xkb.layout = config.mainUser.layout;
xkb.variant = config.mainUser.variant;
enable = true;
displayManager = mkIf (!config.services.xserver.displayManager.sddm.enable) {
config = mkIf cfg.enable {
services.xserver = {
xkb.layout = config.mainUser.layout;
xkb.variant = config.mainUser.variant;
enable = true;
displayManager =
mkIf (!config.services.xserver.displayManager.sddm.enable) {
gdm.enable = true;
};
};
environment.sessionVariables = {
WLR_NO_HARDWARE_CURSORS = "1";
#WLR_DRM_NO_ATOMIC="1";
#WLR_DRM_DEVICES = "/dev/dri/card0";
LIBVA_DRIVER_NAME = "nvidia";
# black screen :(
#XDG_SESSION_TYPE = "wayland";
GBM_BACKEND = "nvidia-drm";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
WLR_RENDERER_ALLOW_SOFTWARE = "1";
};
hardware = {
# Opengl
opengl.enable = true;
# Most wayland compositors need this
nvidia.modesetting.enable = true;
};
xdg.portal.enable = true;
xdg.portal.extraPortals = lib.mkDefault [ pkgs.xdg-desktop-portal-gtk ];
programs.hyprland = {
enable = true;
package = pkgs.unstable.hyprland;
};
security.pam.services = {
swaylock = {
fprintAuth = false;
text = ''
auth include login
'';
};
environment.sessionVariables = {
WLR_NO_HARDWARE_CURSORS="1";
#WLR_DRM_NO_ATOMIC="1";
#WLR_DRM_DEVICES = "/dev/dri/card0";
LIBVA_DRIVER_NAME="nvidia";
# black screen :(
#XDG_SESSION_TYPE = "wayland";
GBM_BACKEND = "nvidia-drm";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
WLR_RENDERER_ALLOW_SOFTWARE="1";
};
hardware = {
# Opengl
opengl.enable = true;
# Most wayland compositors need this
nvidia.modesetting.enable = true;
};
xdg.portal.enable = true;
xdg.portal.extraPortals = lib.mkDefault [ pkgs.xdg-desktop-portal-gtk ];
programs.hyprland = {
enable = true;
package = pkgs.unstable.hyprland;
};
security.pam.services = {
swaylock = {
fprintAuth = false;
text = ''
auth include login
'';
};
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# hyprland stuff
patchedWaybar
dunst
swww
rofi-wayland
libnotify
networkmanagerapplet
wayland
wl-clipboard
#qt5.qtwayland
#qt6.qmake
#qt6.qtwayland
#waybar
#xdg-desktop-portal-hyprland
#xdg-desktop-portal-gtk
#xdg-utils
#xwayland
];
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# hyprland stuff
dunst
swww
rofi-wayland
libnotify
networkmanagerapplet
wayland
wl-clipboard
#qt5.qtwayland
#qt6.qmake
#qt6.qtwayland
#waybar
#xdg-desktop-portal-hyprland
#xdg-desktop-portal-gtk
#xdg-utils
#xwayland
];
};
}

View File

@@ -20,7 +20,7 @@ in
fonts.packages = with pkgs; [
#uw-ttyp0
corefonts
(nerdfonts.override { fonts = ["Hack" "Noto"]; })
nerdfonts
#noto-fonts
#noto-fonts-emoji
noto-fonts-cjk

View File

@@ -34,7 +34,7 @@ in {
let nerdfonts = pkgs.nerdfonts.override { fonts = [ "Hack" "Noto" ]; };
in mkIf cfg.enable {
stylix = {
autoEnable = true;
autoEnable = mkForce true;
polarity = "dark";
image = cfg.image;
override = cfg.override;