modularize system graphics settings

This commit is contained in:
Fabian Montero 2024-12-02 14:28:35 -06:00
parent 01f1576b8a
commit 99816f0d3f
Signed by: fabian
GPG key ID: 1FFAC35E1798174F
4 changed files with 50 additions and 19 deletions

View file

@ -8,5 +8,6 @@
./baseline.nix
./yubikey.nix
./audio.nix
./graphics.nix
];
}

25
sys/modules/graphics.nix Normal file
View file

@ -0,0 +1,25 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.sys.graphics;
in {
options.local.sys.graphics = {
enable = mkEnableOption "graphics settings";
};
config = mkIf cfg.enable {
services.xserver = {
enable = true;
xkb.layout = "us"; #TODO
displayManager.startx.enable = true; #TODO maybe crear un modulo para ly?
libinput.enable = true;
};
hardware.graphics.enable = true;
programs.dconf.enable = true;
};
}

View file

@ -0,0 +1,23 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.sys.virtualisation;
in {
options.local.sys.virtualisation = {
enable = mkEnableOption "virtualisation settings";
};
config = mkIf cfg.enable {
virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm;
virtualisation.libvirtd.qemu.ovmf.enable = true;
virtualisation.libvirtd.qemu.ovmf.packages = [pkgs.OVMFFull.fd];
virtualisation.libvirtd.enable = true;
programs.dconf.enable = true;
# boot.kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ];
# boot.kernelParams = [ "amd_iommu=on" "iommu=pt" "vfio-pci.ids=1002:699f,1002:aae0" "video=efifb:off" ];
virtualisation.libvirtd.onBoot = "start";
};
}

View file

@ -17,6 +17,7 @@
yubikey.enable = true;
audio.enable = true;
graphics.enable = true;
};
# Use the systemd-boot EFI boot loader.
@ -41,16 +42,6 @@
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Enable the X11 windowing system.
services.xserver = {
enable = true;
xkb.layout = "us";
displayManager.startx.enable = true;
};
services.libinput.enable = true;
hardware.graphics.enable = true;
users = {
users.fabian = {
isNormalUser = true;
@ -65,13 +56,4 @@
services.udev.packages = [
pkgs.android-udev-rules
];
virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm;
virtualisation.libvirtd.qemu.ovmf.enable = true;
virtualisation.libvirtd.qemu.ovmf.packages = [pkgs.OVMFFull.fd];
virtualisation.libvirtd.enable = true;
programs.dconf.enable = true;
# boot.kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ];
# boot.kernelParams = [ "amd_iommu=on" "iommu=pt" "vfio-pci.ids=1002:699f,1002:aae0" "video=efifb:off" ];
virtualisation.libvirtd.onBoot = "start";
}