Refactor modules style
This commit is contained in:
parent
ed2a7f94cf
commit
cc95386f1a
44 changed files with 455 additions and 297 deletions
9
nixosModules/services/graphics/default.nix
Normal file
9
nixosModules/services/graphics/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./display_manager
|
||||
./nvidia
|
||||
./wayland_compositors
|
||||
];
|
||||
}
|
||||
23
nixosModules/services/graphics/display_manager/default.nix
Normal file
23
nixosModules/services/graphics/display_manager/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
options = {
|
||||
tuigreet.enable = lib.mkEnableOption "enables tuigreet with greetd";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.tuigreet.enable {
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
package = pkgs.greetd.tuigreet;
|
||||
settings = {
|
||||
terminal = {
|
||||
vt = 2;
|
||||
};
|
||||
default_session = lib.mkIf config.hyprland.enable {
|
||||
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland";
|
||||
user = config.user.name;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
28
nixosModules/services/graphics/nvidia/default.nix
Normal file
28
nixosModules/services/graphics/nvidia/default.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
options = {
|
||||
nvidia.enable = lib.mkEnableOption
|
||||
"Enables nvidia with proprietary drivers";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.nvidia.enable {
|
||||
# Enable OpenGL
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
nvidia-vaapi-driver
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{ inputs, config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
options = {
|
||||
hyprland.enable = lib.mkEnableOption "Enables hyprland";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.hyprland.enable {
|
||||
imports = [ inputs.hyprland.nixosModules.default ];
|
||||
programs.hyprland.enable = true;
|
||||
nix.settings = {
|
||||
substituters = [ "https://hyprland.cachix.org" ];
|
||||
trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ];
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue