forked from fabian/nix
		
	modularize system graphics settings
This commit is contained in:
		
							parent
							
								
									01f1576b8a
								
							
						
					
					
						commit
						99816f0d3f
					
				
					 4 changed files with 50 additions and 19 deletions
				
			
		|  | @ -8,5 +8,6 @@ | ||||||
|     ./baseline.nix |     ./baseline.nix | ||||||
|     ./yubikey.nix |     ./yubikey.nix | ||||||
|     ./audio.nix |     ./audio.nix | ||||||
|  |     ./graphics.nix | ||||||
|   ]; |   ]; | ||||||
| } | } | ||||||
|  |  | ||||||
							
								
								
									
										25
									
								
								sys/modules/graphics.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								sys/modules/graphics.nix
									
										
									
									
									
										Normal 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; | ||||||
|  |   }; | ||||||
|  | } | ||||||
							
								
								
									
										23
									
								
								sys/modules/virtualisation.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								sys/modules/virtualisation.nix
									
										
									
									
									
										Normal 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"; | ||||||
|  |   }; | ||||||
|  | } | ||||||
|  | @ -17,6 +17,7 @@ | ||||||
| 
 | 
 | ||||||
|     yubikey.enable = true; |     yubikey.enable = true; | ||||||
|     audio.enable = true; |     audio.enable = true; | ||||||
|  |     graphics.enable = true; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   # Use the systemd-boot EFI boot loader. |   # Use the systemd-boot EFI boot loader. | ||||||
|  | @ -41,16 +42,6 @@ | ||||||
|   # Select internationalisation properties. |   # Select internationalisation properties. | ||||||
|   i18n.defaultLocale = "en_US.UTF-8"; |   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 = { | ||||||
|     users.fabian = { |     users.fabian = { | ||||||
|       isNormalUser = true; |       isNormalUser = true; | ||||||
|  | @ -65,13 +56,4 @@ | ||||||
|   services.udev.packages = [ |   services.udev.packages = [ | ||||||
|     pkgs.android-udev-rules |     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"; |  | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue