forked from jan-leila/nix-config
		
	restructured repo to support nix-darwin
This commit is contained in:
		
							parent
							
								
									3924a5aa8d
								
							
						
					
					
						commit
						0d0443a02a
					
				
					 47 changed files with 111 additions and 34 deletions
				
			
		
							
								
								
									
										233
									
								
								configurations/nixos/twilight/configuration.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										233
									
								
								configurations/nixos/twilight/configuration.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,233 @@ | |||
| {pkgs, ...}: { | ||||
|   nixpkgs.config.allowUnfree = true; | ||||
| 
 | ||||
|   host = { | ||||
|     users = { | ||||
|       leyla = { | ||||
|         isDesktopUser = true; | ||||
|         isTerminalUser = true; | ||||
|         isPrincipleUser = true; | ||||
|       }; | ||||
|       ester.isDesktopUser = true; | ||||
|       eve.isDesktopUser = true; | ||||
|     }; | ||||
|     hardware = { | ||||
|       piperMouse.enable = true; | ||||
|       viaKeyboard.enable = true; | ||||
|       openRGB.enable = true; | ||||
|       graphicsAcceleration.enable = true; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   systemd.tmpfiles.rules = [ | ||||
|     "L+ /run/gdm/.config/monitors.xml - - - - ${pkgs.writeText "gdm-monitors.xml" '' | ||||
|       <monitors version="2"> | ||||
|         <configuration> | ||||
|           <logicalmonitor> | ||||
|             <x>0</x> | ||||
|             <y>156</y> | ||||
|             <scale>1</scale> | ||||
|             <monitor> | ||||
|               <monitorspec> | ||||
|                 <connector>DP-4</connector> | ||||
|                 <vendor>DEL</vendor> | ||||
|                 <product>DELL U2719D</product> | ||||
|                 <serial>8RGXNS2</serial> | ||||
|               </monitorspec> | ||||
|               <mode> | ||||
|                 <width>2560</width> | ||||
|                 <height>1440</height> | ||||
|                 <rate>59.951</rate> | ||||
|               </mode> | ||||
|             </monitor> | ||||
|           </logicalmonitor> | ||||
|           <logicalmonitor> | ||||
|             <x>2560</x> | ||||
|             <y>324</y> | ||||
|             <scale>1</scale> | ||||
|             <primary>yes</primary> | ||||
|             <monitor> | ||||
|               <monitorspec> | ||||
|                 <connector>DP-2</connector> | ||||
|                 <vendor>GSM</vendor> | ||||
|                 <product>LG ULTRAGEAR</product> | ||||
|                 <serial>0x00068c96</serial> | ||||
|               </monitorspec> | ||||
|               <mode> | ||||
|                 <width>1920</width> | ||||
|                 <height>1080</height> | ||||
|                 <rate>240.001</rate> | ||||
|               </mode> | ||||
|             </monitor> | ||||
|           </logicalmonitor> | ||||
|           <logicalmonitor> | ||||
|             <x>4480</x> | ||||
|             <y>0</y> | ||||
|             <scale>1</scale> | ||||
|             <transform> | ||||
|               <rotation>left</rotation> | ||||
|               <flipped>no</flipped> | ||||
|             </transform> | ||||
|             <monitor> | ||||
|               <monitorspec> | ||||
|                 <connector>HDMI-0</connector> | ||||
|                 <vendor>HWP</vendor> | ||||
|                 <product>HP w2207</product> | ||||
|                 <serial>CND7332S88</serial> | ||||
|               </monitorspec> | ||||
|               <mode> | ||||
|                 <width>1600</width> | ||||
|                 <height>1000</height> | ||||
|                 <rate>59.999</rate> | ||||
|               </mode> | ||||
|             </monitor> | ||||
|           </logicalmonitor> | ||||
|         </configuration> | ||||
|         <configuration> | ||||
|           <logicalmonitor> | ||||
|             <x>0</x> | ||||
|             <y>0</y> | ||||
|             <scale>1</scale> | ||||
|             <primary>yes</primary> | ||||
|             <monitor> | ||||
|               <monitorspec> | ||||
|                 <connector>DP-1</connector> | ||||
|                 <vendor>DEL</vendor> | ||||
|                 <product>DELL U2719D</product> | ||||
|                 <serial>8RGXNS2</serial> | ||||
|               </monitorspec> | ||||
|               <mode> | ||||
|                 <width>2560</width> | ||||
|                 <height>1440</height> | ||||
|                 <rate>59.951</rate> | ||||
|               </mode> | ||||
|             </monitor> | ||||
|           </logicalmonitor> | ||||
|           <logicalmonitor> | ||||
|             <x>4480</x> | ||||
|             <y>226</y> | ||||
|             <scale>1</scale> | ||||
|             <transform> | ||||
|               <rotation>left</rotation> | ||||
|               <flipped>no</flipped> | ||||
|             </transform> | ||||
|             <monitor> | ||||
|               <monitorspec> | ||||
|                 <connector>HDMI-1</connector> | ||||
|                 <vendor>HWP</vendor> | ||||
|                 <product>HP w2207</product> | ||||
|                 <serial>CND7332S88</serial> | ||||
|               </monitorspec> | ||||
|               <mode> | ||||
|                 <width>1680</width> | ||||
|                 <height>1050</height> | ||||
|                 <rate>59.954</rate> | ||||
|               </mode> | ||||
|             </monitor> | ||||
|           </logicalmonitor> | ||||
|           <logicalmonitor> | ||||
|             <x>2560</x> | ||||
|             <y>226</y> | ||||
|             <scale>1</scale> | ||||
|             <monitor> | ||||
|               <monitorspec> | ||||
|                 <connector>DP-2</connector> | ||||
|                 <vendor>GSM</vendor> | ||||
|                 <product>LG ULTRAGEAR</product> | ||||
|                 <serial>0x00068c96</serial> | ||||
|               </monitorspec> | ||||
|               <mode> | ||||
|                 <width>1920</width> | ||||
|                 <height>1080</height> | ||||
|                 <rate>240.001</rate> | ||||
|               </mode> | ||||
|             </monitor> | ||||
|           </logicalmonitor> | ||||
|         </configuration> | ||||
|         <configuration> | ||||
|           <logicalmonitor> | ||||
|             <x>2560</x> | ||||
|             <y>228</y> | ||||
|             <scale>1</scale> | ||||
|             <primary>yes</primary> | ||||
|             <monitor> | ||||
|               <monitorspec> | ||||
|                 <connector>DP-2</connector> | ||||
|                 <vendor>GSM</vendor> | ||||
|                 <product>LG ULTRAGEAR</product> | ||||
|                 <serial>0x00068c96</serial> | ||||
|               </monitorspec> | ||||
|               <mode> | ||||
|                 <width>1920</width> | ||||
|                 <height>1080</height> | ||||
|                 <rate>240.001</rate> | ||||
|               </mode> | ||||
|             </monitor> | ||||
|           </logicalmonitor> | ||||
|           <logicalmonitor> | ||||
|             <x>4480</x> | ||||
|             <y>69</y> | ||||
|             <scale>1</scale> | ||||
|             <transform> | ||||
|               <rotation>left</rotation> | ||||
|               <flipped>no</flipped> | ||||
|             </transform> | ||||
|             <monitor> | ||||
|               <monitorspec> | ||||
|                 <connector>HDMI-1</connector> | ||||
|                 <vendor>HWP</vendor> | ||||
|                 <product>HP w2207</product> | ||||
|                 <serial>CND7332S88</serial> | ||||
|               </monitorspec> | ||||
|               <mode> | ||||
|                 <width>1680</width> | ||||
|                 <height>1050</height> | ||||
|                 <rate>59.954</rate> | ||||
|               </mode> | ||||
|             </monitor> | ||||
|           </logicalmonitor> | ||||
|           <logicalmonitor> | ||||
|             <x>0</x> | ||||
|             <y>0</y> | ||||
|             <scale>1</scale> | ||||
|             <monitor> | ||||
|               <monitorspec> | ||||
|                 <connector>DP-3</connector> | ||||
|                 <vendor>DEL</vendor> | ||||
|                 <product>DELL U2719D</product> | ||||
|                 <serial>8RGXNS2</serial> | ||||
|               </monitorspec> | ||||
|               <mode> | ||||
|                 <width>2560</width> | ||||
|                 <height>1440</height> | ||||
|                 <rate>59.951</rate> | ||||
|               </mode> | ||||
|             </monitor> | ||||
|           </logicalmonitor> | ||||
|           <disabled> | ||||
|             <monitorspec> | ||||
|               <connector>None-1</connector> | ||||
|               <vendor>unknown</vendor> | ||||
|               <product>unknown</product> | ||||
|               <serial>unknown</serial> | ||||
|             </monitorspec> | ||||
|           </disabled> | ||||
|         </configuration> | ||||
|       </monitors> | ||||
|     ''}" | ||||
|   ]; | ||||
| 
 | ||||
|   # enabled virtualisation for docker | ||||
|   # virtualisation.docker.enable = true; | ||||
| 
 | ||||
|   # Enable touchpad support (enabled default in most desktopManager). | ||||
|   # services.xserver.libinput.enable = true; | ||||
| 
 | ||||
|   # This value determines the NixOS release from which the default | ||||
|   # settings for stateful data, like file locations and database versions | ||||
|   # on your system were taken. It's perfectly fine and recommended to leave | ||||
|   # this value at the release version of the first install of this system. | ||||
|   # Before changing this value read the documentation for this option | ||||
|   # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). | ||||
|   system.stateVersion = "23.05"; # Did you read the comment? | ||||
| } | ||||
							
								
								
									
										7
									
								
								configurations/nixos/twilight/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								configurations/nixos/twilight/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,7 @@ | |||
| # leyla desktop | ||||
| {...}: { | ||||
|   imports = [ | ||||
|     ./configuration.nix | ||||
|     ./hardware-configuration.nix | ||||
|   ]; | ||||
| } | ||||
							
								
								
									
										125
									
								
								configurations/nixos/twilight/hardware-configuration.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										125
									
								
								configurations/nixos/twilight/hardware-configuration.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,125 @@ | |||
| # Do not modify this file!  It was generated by ‘nixos-generate-config’ | ||||
| # and may be overwritten by future invocations.  Please make changes | ||||
| # to /etc/nixos/configuration.nix instead. | ||||
| { | ||||
|   config, | ||||
|   lib, | ||||
|   pkgs, | ||||
|   modulesPath, | ||||
|   ... | ||||
| }: { | ||||
|   imports = [ | ||||
|     (modulesPath + "/installer/scan/not-detected.nix") | ||||
|   ]; | ||||
| 
 | ||||
|   boot = { | ||||
|     initrd = { | ||||
|       availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; | ||||
|       kernelModules = []; | ||||
|     }; | ||||
|     kernelModules = ["kvm-amd" "sg"]; | ||||
|     extraModulePackages = []; | ||||
| 
 | ||||
|     # Bootloader. | ||||
|     loader = { | ||||
|       systemd-boot.enable = true; | ||||
|       efi.canTouchEfiVariables = true; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   services.xserver = { | ||||
|     # Load nvidia driver for Xorg and Wayland | ||||
|     videoDrivers = ["nvidia"]; | ||||
| 
 | ||||
|     # Use X instead of wayland for gaming reasons | ||||
|     displayManager.gdm.wayland = false; | ||||
|   }; | ||||
| 
 | ||||
|   fileSystems = { | ||||
|     "/" = { | ||||
|       device = "/dev/disk/by-uuid/8be49c65-2b57-48f1-b74d-244d26061adb"; | ||||
|       fsType = "ext4"; | ||||
|     }; | ||||
| 
 | ||||
|     "/boot" = { | ||||
|       device = "/dev/disk/by-uuid/3006-3867"; | ||||
|       fsType = "vfat"; | ||||
|       options = ["fmask=0022" "dmask=0022"]; | ||||
|     }; | ||||
| 
 | ||||
|     "/mnt/leyla_home" = { | ||||
|       device = "server.arpa:/home/leyla"; | ||||
|       fsType = "nfs"; | ||||
|       options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"]; | ||||
|     }; | ||||
| 
 | ||||
|     "/mnt/share_home" = { | ||||
|       device = "server.arpa:/home/share"; | ||||
|       fsType = "nfs"; | ||||
|       options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"]; | ||||
|     }; | ||||
| 
 | ||||
|     "/mnt/docker_home" = { | ||||
|       device = "server.arpa:/home/docker"; | ||||
|       fsType = "nfs"; | ||||
|       options = ["x-systemd.automount" "noauto" "x-systemd.idle-timeout=600"]; | ||||
|     }; | ||||
|   }; | ||||
| 
 | ||||
|   environment.systemPackages = with pkgs; [ | ||||
|     cachefilesd | ||||
|   ]; | ||||
| 
 | ||||
|   swapDevices = []; | ||||
| 
 | ||||
|   networking = { | ||||
|     networkmanager.enable = true; | ||||
|     # Enables DHCP on each ethernet and wireless interface. In case of scripted networking | ||||
|     # (the default) this is the recommended approach. When using systemd-networkd it's | ||||
|     # still possible to use this option, but it's recommended to use it in conjunction | ||||
|     # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. | ||||
|     useDHCP = lib.mkDefault true; | ||||
|     hostName = "twilight"; # Define your hostname. | ||||
|   }; | ||||
| 
 | ||||
|   nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; | ||||
| 
 | ||||
|   hardware = { | ||||
|     # Enable OpenGL | ||||
|     graphics.enable = true; | ||||
| 
 | ||||
|     # install graphics drivers | ||||
|     nvidia = { | ||||
|       # Modesetting is required. | ||||
|       modesetting.enable = true; | ||||
| 
 | ||||
|       # Nvidia power management. Experimental, and can cause sleep/suspend to fail. | ||||
|       # Enable this if you have graphical corruption issues or application crashes after waking | ||||
|       # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead | ||||
|       # of just the bare essentials. | ||||
|       powerManagement.enable = false; | ||||
| 
 | ||||
|       # Fine-grained power management. Turns off GPU when not in use. | ||||
|       # Experimental and only works on modern Nvidia GPUs (Turing or newer). | ||||
|       powerManagement.finegrained = false; | ||||
| 
 | ||||
|       # Use the NVidia open source kernel module (not to be confused with the | ||||
|       # independent third-party "nouveau" open source driver). | ||||
|       # Support is limited to the Turing and later architectures. Full list of | ||||
|       # supported GPUs is at: | ||||
|       # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus | ||||
|       # Only available from driver 515.43.04+ | ||||
|       # Currently alpha-quality/buggy, so false is currently the recommended setting. | ||||
|       open = false; | ||||
| 
 | ||||
|       # Enable the Nvidia settings menu, | ||||
|       # accessible via `nvidia-settings`. | ||||
|       nvidiaSettings = true; | ||||
| 
 | ||||
|       # Optionally, you may need to select the appropriate driver version for your specific GPU. | ||||
|       package = config.boot.kernelPackages.nvidiaPackages.production; | ||||
|     }; | ||||
| 
 | ||||
|     cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue