mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	@@ -75,6 +75,7 @@ See code for all available configurations.
 | 
			
		||||
| [Apple MacBook Pro 12,1](apple/macbook-pro/12-1)                    | `<nixos-hardware/apple/macbook-pro/12-1>`          |
 | 
			
		||||
| [Apple MacBook Pro 10,1](apple/macbook-pro/10-1)                    | `<nixos-hardware/apple/macbook-pro/10-1>`          |
 | 
			
		||||
| [Asus TUF FX504GD](asus/fx504gd)                                    | `<nixos-hardware/asus/fx504gd>`                    |
 | 
			
		||||
| [Asus ROG Strix G733QS](asus/rog-strix/g733qs)                      | `<nixos-hardware/asus/rog-strix/g733qs>`                |
 | 
			
		||||
| [Asus ROG Zephyrus G14 GA401](asus/zephyrus/ga401)                  | `<nixos-hardware/asus/zephyrus/ga401>`             |
 | 
			
		||||
| [BeagleBoard PocketBeagle](beagleboard/pocketbeagle)                | `<nixos-hardware/beagleboard/pocketbeagle>`        |
 | 
			
		||||
| [Dell G3 3779](dell/g3/3779)                                        | `<nixos-hardware/dell/g3/3779>`                    |
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										21
									
								
								asus/battery.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								asus/battery.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
{ config, pkgs, lib, ... }:
 | 
			
		||||
let
 | 
			
		||||
  p = pkgs.writeScriptBin "charge-upto" ''
 | 
			
		||||
    echo ''${0:-100} > /sys/class/power_supply/BAT0/charge_control_end_threshold
 | 
			
		||||
  '';
 | 
			
		||||
  cfg = config.hardware.asus;
 | 
			
		||||
in
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  options.hardware.asus.battery.chargeUpto = lib.mkOption {
 | 
			
		||||
    description = "Maximum level of charge for your battery, as a percentage.";
 | 
			
		||||
    default = 100;
 | 
			
		||||
    type = lib.types.int;
 | 
			
		||||
  };
 | 
			
		||||
  config = {
 | 
			
		||||
    environment.systemPackages = [ p ];
 | 
			
		||||
    systemd.tmpfiles.rules = [
 | 
			
		||||
      "w /sys/class/power_supply/BAT0/charge_control_end_threshold - - - - ${toString cfg.battery.chargeUpto}"
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								asus/rog-strix/g733qs/default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								asus/rog-strix/g733qs/default.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
{ config, pkgs, lib, ... }:
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../../../common/cpu/amd
 | 
			
		||||
    ../../../common/gpu/nvidia.nix
 | 
			
		||||
    ../../../common/pc/laptop
 | 
			
		||||
    ../../../common/pc/ssd
 | 
			
		||||
    ../../battery.nix
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  # fixing audio by overriding pins as suggested in
 | 
			
		||||
  # https://www.reddit.com/r/ASUS/comments/mfokva/asus_strix_scar_17_g733qs_and_linux/
 | 
			
		||||
  hardware.firmware = [
 | 
			
		||||
    (pkgs.runCommand "jack-retask" { } ''
 | 
			
		||||
      install -D ${./hda-jack-retask.fw} $out/lib/firmware/hda-jack-retask.fw
 | 
			
		||||
    '')
 | 
			
		||||
  ];
 | 
			
		||||
  boot.extraModprobeConfig = ''
 | 
			
		||||
    options snd-hda-intel patch=hda-jack-retask.fw
 | 
			
		||||
  '';
 | 
			
		||||
  # before 5.12 it would interpret every keystroke as the power button
 | 
			
		||||
  boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.12") (lib.mkDefault pkgs.linuxPackages_latest);
 | 
			
		||||
 | 
			
		||||
  hardware.nvidia.prime = {
 | 
			
		||||
    offload.enable = lib.mkDefault true;
 | 
			
		||||
    amdgpuBusId = "PCI:5:0:0";
 | 
			
		||||
    nvidiaBusId = "PCI:1:0:1";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										16
									
								
								asus/rog-strix/g733qs/hda-jack-retask.fw
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								asus/rog-strix/g733qs/hda-jack-retask.fw
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
[codec]
 | 
			
		||||
0x10ec0285 0x10431e6e 0
 | 
			
		||||
 | 
			
		||||
[pincfg]
 | 
			
		||||
0x12 0x90a60140
 | 
			
		||||
0x13 0x40000000
 | 
			
		||||
0x14 0x90170152
 | 
			
		||||
0x16 0x411111f0
 | 
			
		||||
0x17 0x90170110
 | 
			
		||||
0x18 0x411111f0
 | 
			
		||||
0x19 0x03a19020
 | 
			
		||||
0x1a 0x411111f0
 | 
			
		||||
0x1b 0x411111f0
 | 
			
		||||
0x1d 0x40663a45
 | 
			
		||||
0x1e 0x90170151
 | 
			
		||||
0x21 0x03211020
 | 
			
		||||
@@ -4,7 +4,9 @@
 | 
			
		||||
  outputs = { self }: {
 | 
			
		||||
    nixosModules = {
 | 
			
		||||
      dell-aspire-4810t = import ./acer/aspire/4810t;
 | 
			
		||||
      asus-battery = import ./asus/battery.nix;
 | 
			
		||||
      asus-fx504gd = import ./asus/fx504gd;
 | 
			
		||||
      asus-rog-strix-g733qs = import ./asus/rog-strix/g733qs;
 | 
			
		||||
      asus-zephyrus-ga401 = import ./asus/zephyrus/ga401;
 | 
			
		||||
      apple-macbook-air-3 = import ./apple/macbook-air/3;
 | 
			
		||||
      apple-macbook-air-4 = import apple/macbook-air/4;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user