Refactor modules style

This commit is contained in:
Julia Lange 2024-04-07 17:08:48 -07:00
parent ed2a7f94cf
commit cc95386f1a
44 changed files with 455 additions and 297 deletions

View file

@ -0,0 +1,9 @@
{ config, pkgs, lib, ... }:
{
imports = [
./display_manager
./nvidia
./wayland_compositors
];
}

View 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;
};
};
};
};
}

View 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
];
};
}

View file

@ -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" ];
};
};
}