1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-12-27 12:09:45 +01:00

Added ROG Strix G733QS

This commit is contained in:
Pasquale 2021-11-19 00:01:56 +01:00
parent 5a7e613703
commit 6479f584f7
No known key found for this signature in database
GPG key ID: 13160FFB4CEB03F2
5 changed files with 69 additions and 0 deletions

View file

@ -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/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
View 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.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.chargeUpto}"
];
};
}

View 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.mkDefault pkgs.linuxPackages_latest;
hardware.nvidia.prime = {
offload.enable = lib.mkDefault true;
amdgpuBusId = "PCI:5:0:0";
nvidiaBusId = "PCI:1:0:1";
};
}

View 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

View file

@ -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;