hyprland module consolidation and some refactoring

This commit is contained in:
cnst
2024-10-29 18:33:37 +01:00
parent 9609b2a47a
commit 9f05e45d68
46 changed files with 1115 additions and 806 deletions

View File

@@ -72,7 +72,10 @@ in {
};
chaotic = mkIf (cfg.variant == "cachyos") {
scx.enable = true;
scx = {
enable = true;
scheduler = "scx_lavd";
};
};
};
}

View File

@@ -12,11 +12,10 @@ in {
enable = mkEnableOption "AMD graphics support";
packageSet = mkOption {
type = types.enum ["standard" "chaotic" "minimal"];
default = "minimal";
type = types.enum ["standard" "chaotic"];
default = "standard";
description = ''
Which set of AMD graphics packages to use:
- minimal: Only basic drivers and libraries
- standard: Additional AMD-specific tools and utilities
- chaotic: Chaotic Mesa git version with additional optimizations
'';
@@ -26,35 +25,37 @@ in {
config = mkIf cfg.enable (mkMerge [
{
# Base configuration that applies regardless of package set
# Base configuration
hardware.graphics = {
enable = true;
enable32Bit = true;
};
}
# Standard Package Set
(mkIf (cfg.packageSet == "standard") {
hardware.graphics = {
extraPackages = with pkgs; [
libva
vaapiVdpau
libvdpau-va-gl
amdvlk
vulkan-tools
];
extraPackages32 = with pkgs.pkgsi686Linux; [
vaapiVdpau
libvdpau-va-gl
];
};
hardware.graphics.extraPackages = with pkgs; [
libva
vaapiVdpau
libvdpau-va-gl
vulkan-loader
vulkan-validation-layers
vulkan-extension-layer
];
hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [
vaapiVdpau
libvdpau-va-gl
];
environment.systemPackages = with pkgs; [
vulkan-tools
wayland
wayland-protocols
];
})
# Chaotic Package Set
(mkIf (cfg.packageSet == "chaotic") {
chaotic = {
scx = {
enable = true;
scheduler = "scx_lavd";
};
mesa-git = {
enable = true;
extraPackages = with pkgs; [
@@ -65,18 +66,14 @@ in {
latencyflex-vulkan
mesa_git
mesa_git.opencl
vulkanPackages_latest.gfxreconstruct
vulkanPackages_latest.spirv-cross
vulkanPackages_latest.vulkan-loader
vulkanPackages_latest.vulkan-headers
vulkanPackages_latest.vulkan-validation-layers
vulkanPackages_latest.vulkan-extension-layer
vulkanPackages_latest.vulkan-utility-libraries
vulkanPackages_latest.vulkan-volk
vulkanPackages_latest.spirv-headers
vulkanPackages_latest.spirv-tools
vulkanPackages_latest.vulkan-extension-layer
vulkanPackages_latest.vulkan-headers
vulkanPackages_latest.vulkan-loader
vulkanPackages_latest.vulkan-tools
vulkanPackages_latest.vulkan-tools-lunarg
vulkanPackages_latest.vulkan-utility-libraries
vulkanPackages_latest.vulkan-validation-layers
vulkanPackages_latest.vulkan-volk
];
extraPackages32 = with pkgs.pkgsi686Linux; [
pkgs.mesa32_git
@@ -88,6 +85,14 @@ in {
];
};
};
environment.systemPackages = with pkgs; [
vulkanPackages_latest.vulkan-tools
vulkanPackages_latest.vulkan-tools-lunarg
vulkanPackages_latest.gfxreconstruct
vulkanPackages_latest.spirv-cross
wayland-protocols_git
wayland_git
];
})
]);
}

View File

@@ -9,11 +9,6 @@ in {
options = {
nixos.hardware.network = {
enable = mkEnableOption "Enable the custom networking module";
hostName = mkOption {
type = types.str;
default = "default-hostname";
description = "Hostname for the nixos.";
};
interfaces = mkOption {
type = types.attrsOf (types.submodule {
options = {
@@ -53,7 +48,6 @@ in {
networking = {
networkmanager.enable = true;
inherit (cfg) hostName;
nftables.enable = true;
firewall = {
enable = true;

View File

@@ -7,7 +7,7 @@
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.nixos.programs.hyprland;
hyprsysteminfoFlake = inputs.hyprsysteminfo.packages.${pkgs.system}.default;
# hyprsysteminfoFlake = inputs.hyprsysteminfo.packages.${pkgs.system}.default;
in {
options = {
nixos.programs.hyprland.enable = mkEnableOption "Enables hyprland";
@@ -17,14 +17,14 @@ in {
programs.hyprland = {
enable = true;
xwayland.enable = true;
package = inputs.hyprland.packages.${pkgs.system}.default;
portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
package = pkgs.hyprland;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
};
environment = {
variables.NIXOS_OZONE_WL = "1";
systemPackages = [
pkgs.hyprwayland-scanner
hyprsysteminfoFlake
# pkgs.hyprwayland-scanner
# hyprsysteminfoFlake
];
};
};

View File

@@ -14,8 +14,6 @@ in {
environment.systemPackages = with pkgs; [
lutris
bottles
wineWowPackages.waylandFull
wineWowPackages.stagingFull
];
};
}

View File

@@ -27,6 +27,7 @@ in {
(mkIf cfg.desktop.enable [
pkgs.protonup
pkgs.winetricks
pkgs.wine
])
];
};

View File

@@ -24,7 +24,7 @@ in {
default = false;
description = "Enables autologin for a specified user.";
};
autologin.user = mkOption {
user = mkOption {
type = types.str;
default = "cnst";
description = "The username to auto-login when autologin is enabled.";
@@ -39,14 +39,14 @@ in {
# Conditionally include initial_session if autologin is enabled
(mkIf cfg.autologin.enable {
initial_session = {
command = "${pkgs.hyprland}/bin/Hyprland";
user = cfg.autologin.user;
command = "${lib.getExe config.programs.hyprland.package}";
user = cfg.user;
};
})
{
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet -r --remember-session --asterisks";
user = "greeter";
user = cfg.user;
};
}
];

View File

@@ -22,6 +22,7 @@ in {
};
config = {
services.xserver = {
enable = true;
videoDrivers = cfg.videoDrivers;
xkb.layout = cfg.xkbLayout;
};

View File

@@ -34,7 +34,7 @@ in {
clang-tools
marksman
pyright
nodePackages_latest.intelephense
# nodePackages_latest.intelephense
# Formatters
alejandra

View File

@@ -23,7 +23,7 @@ in {
enable = true;
xdgOpenUsePortal = cfg.xdgOpenUsePortal;
config = {
common.default = "*";
common.default = ["gtk"];
hyprland.default = ["hyprland" "gtk"];
};
extraPortals = [pkgs.xdg-desktop-portal-gtk];