diff --git a/sys/modules/default.nix b/sys/modules/default.nix index eed6ea4..49af04c 100644 --- a/sys/modules/default.nix +++ b/sys/modules/default.nix @@ -8,5 +8,6 @@ ./baseline.nix ./yubikey.nix ./audio.nix + ./graphics.nix ]; } diff --git a/sys/modules/graphics.nix b/sys/modules/graphics.nix new file mode 100644 index 0000000..98fa94a --- /dev/null +++ b/sys/modules/graphics.nix @@ -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; + }; +} diff --git a/sys/modules/virtualisation.nix b/sys/modules/virtualisation.nix new file mode 100644 index 0000000..0ff9627 --- /dev/null +++ b/sys/modules/virtualisation.nix @@ -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"; + }; +} diff --git a/sys/platforms/posixlycorrect/default.nix b/sys/platforms/posixlycorrect/default.nix index 3497bd1..f1974a5 100644 --- a/sys/platforms/posixlycorrect/default.nix +++ b/sys/platforms/posixlycorrect/default.nix @@ -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"; }