Skip to content

Commit 51e51e6

Browse files
committed
chore: format repo using treefmt-nix and nixfmt-rfc-style
1 parent fc7c471 commit 51e51e6

File tree

266 files changed

+3716
-2728
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+3716
-2728
lines changed

airis/n990/default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
kernelParams = [
1010
"apm=on"
1111
"acpi=on"
12-
"vga=0x317" # 1024x768
12+
"vga=0x317" # 1024x768
1313
"console=tty1"
14-
"video=vesafb:ywrap" # Faster scroll
15-
];
14+
"video=vesafb:ywrap" # Faster scroll
15+
];
1616
};
1717

1818
hardware.firmware = with pkgs; [ intel2200BGFirmware ];

apple/default.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"hid_apple.iso_layout=0"
66
];
77

8-
hardware.facetimehd.enable = lib.mkDefault
9-
(config.nixpkgs.config.allowUnfree or false);
8+
hardware.facetimehd.enable = lib.mkDefault (config.nixpkgs.config.allowUnfree or false);
109

1110
services.mbpfan.enable = lib.mkDefault true;
1211
}

apple/imac/18-2/default.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
lib,
44
pkgs,
55
...
6-
}: {
6+
}:
7+
{
78
imports = [
89
../.
910
../../../common/cpu/intel/kaby-lake
@@ -14,7 +15,12 @@
1415

1516
# apple smc (TODO: check spi)
1617
boot = {
17-
initrd.kernelModules = ["applespi" "spi_pxa2xx_platform" "intel_lpss_pci" "applesmc" ];
18+
initrd.kernelModules = [
19+
"applespi"
20+
"spi_pxa2xx_platform"
21+
"intel_lpss_pci"
22+
"applesmc"
23+
];
1824
kernelParams = [ "intel_iommu=on" ];
1925
kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest;
2026
};

apple/macbook-air/3/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ config, lib, ... }:
22

33
{
4-
imports = [
4+
imports = [
55
../../.
66
../../../common/cpu/intel
77
../../../common/pc/laptop

apple/macbook-air/7/default.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
{ config, lib, pkgs, ... }:
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}:
27

38
{
49
imports = [

apple/macbook-pro/11-5/default.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ in
1818
services.udev.extraRules =
1919
# Disable XHC1 wakeup signal to avoid resume getting triggered some time
2020
# after suspend. Reboot required for this to take effect.
21-
lib.optionalString
22-
(lib.versionAtLeast kernelPackages.kernel.version "3.13")
21+
lib.optionalString (lib.versionAtLeast kernelPackages.kernel.version "3.13")
2322
''SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"'';
2423
}

apple/macbook-pro/12-1/default.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
{ lib, pkgs, modulesPath, ... }:
1+
{
2+
lib,
3+
pkgs,
4+
modulesPath,
5+
...
6+
}:
27

38
{
49
imports = [
@@ -19,7 +24,7 @@
1924
powerDownCommands = lib.mkBefore ''
2025
${pkgs.kmod}/bin/rmmod -f -v brcmfmac_wcc 2>/dev/null || true
2126
${pkgs.kmod}/bin/rmmod brcmfmac
22-
'';
27+
'';
2328
};
2429

2530
# USB subsystem wakes up MBP right after suspend unless we disable it.

apple/macbook-pro/14-1/default.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
lib,
44
pkgs,
55
...
6-
}: {
6+
}:
7+
{
78
imports = [
89
../.
910
../../../common/cpu/intel/kaby-lake
@@ -15,7 +16,12 @@
1516
# https://www.kernelconfig.io/config_keyboard_applespi
1617

1718
boot = {
18-
initrd.kernelModules = ["applespi" "spi_pxa2xx_platform" "intel_lpss_pci" "applesmc" ];
19+
initrd.kernelModules = [
20+
"applespi"
21+
"spi_pxa2xx_platform"
22+
"intel_lpss_pci"
23+
"applesmc"
24+
];
1925
kernelParams = [ "intel_iommu=on" ];
2026
kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest;
2127
};

apple/macbook-pro/8-1/default.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
{ config, lib, pkgs, ... }:
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}:
27

38
{
49
imports = [

apple/t2/default.nix

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let
2525
overrideAudioFiles =
2626
package: pluginsPath:
2727
package.overrideAttrs (
28-
new: old: {
28+
_new: old: {
2929
preConfigurePhases = old.preConfigurePhases or [ ] ++ [ "postPatchPhase" ];
3030
postPatchPhase = ''
3131
cp -r ${audioFiles}/files/{profile-sets,paths} ${pluginsPath}/alsa/mixer/
@@ -106,11 +106,16 @@ in
106106
powerManagement.enable = true;
107107
}
108108

109-
(if lib.versionAtLeast nixosVersion "25.05" then {
110-
services.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/";
111-
} else {
112-
hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/";
113-
})
109+
(
110+
if lib.versionAtLeast nixosVersion "25.05" then
111+
{
112+
services.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/";
113+
}
114+
else
115+
{
116+
hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/";
117+
}
118+
)
114119

115120
(lib.mkIf t2Cfg.enableIGPU {
116121
# Enable the iGPU by default if present

asus/ally/rc71l/default.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@
1111

1212
# 6.5 adds many fixes and improvements for the Ally
1313
# This includes for example performance, audio and bluetooth
14-
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.5") (lib.mkDefault pkgs.linuxPackages_latest);
14+
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.5") (
15+
lib.mkDefault pkgs.linuxPackages_latest
16+
);
1517
}

asus/battery.nix

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
{ config, pkgs, lib, ... }:
1+
{
2+
config,
3+
pkgs,
4+
lib,
5+
...
6+
}:
27
let
38
p = pkgs.writeScriptBin "charge-upto" ''
49
echo ''${0:-100} > /sys/class/power_supply/BAT?/charge_control_end_threshold
@@ -22,8 +27,14 @@ in
2227
config = {
2328
environment.systemPackages = lib.mkIf cfg.enableChargeUptoScript [ p ];
2429
systemd.services.battery-charge-threshold = {
25-
wantedBy = [ "local-fs.target" "suspend.target" ];
26-
after = [ "local-fs.target" "suspend.target" ];
30+
wantedBy = [
31+
"local-fs.target"
32+
"suspend.target"
33+
];
34+
after = [
35+
"local-fs.target"
36+
"suspend.target"
37+
];
2738
description = "Set the battery charge threshold to ${toString cfg.chargeUpto}%";
2839
startLimitBurst = 5;
2940
startLimitIntervalSec = 1;

asus/fa507nv/default.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
pkgs,
44
config,
55
...
6-
}: {
6+
}:
7+
{
78
imports = [
89
../../common/cpu/amd
910
../../common/cpu/amd/raphael/igpu.nix
@@ -20,7 +21,9 @@
2021

2122
# The bottom 2 parts are taken from the framework 16-inch laptops configurations.
2223
# Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/[email protected]/
23-
boot.kernelParams = lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") ["rtc_cmos.use_acpi_alarm=1"];
24+
boot.kernelParams =
25+
lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8")
26+
[ "rtc_cmos.use_acpi_alarm=1" ];
2427

2528
# AMD has better battery life with PPD over TLP:
2629
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13

asus/fa507rm/default.nix

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{ ... }:
22

33
{
4-
imports = [
5-
../../common/cpu/amd
6-
../../common/gpu/nvidia/prime.nix
7-
../../common/gpu/nvidia/ampere
8-
../../common/pc/laptop
9-
../../common/pc/ssd
10-
];
4+
imports = [
5+
../../common/cpu/amd
6+
../../common/gpu/nvidia/prime.nix
7+
../../common/gpu/nvidia/ampere
8+
../../common/pc/laptop
9+
../../common/pc/ssd
10+
];
1111

12-
hardware.nvidia.prime = {
13-
amdgpuBusId = "PCI:5:0:0";
14-
nvidiaBusId = "PCI:1:0:0";
15-
};
16-
}
12+
hardware.nvidia.prime = {
13+
amdgpuBusId = "PCI:5:0:0";
14+
nvidiaBusId = "PCI:1:0:0";
15+
};
16+
}

asus/flow/gv302x/amdgpu/default.nix

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{ config,
1+
{
2+
config,
23
lib,
34
...
45
}:
@@ -7,15 +8,22 @@ let
78
inherit (lib) mkEnableOption mkIf mkMerge;
89
cfg = config.hardware.asus.flow.gv302x;
910

10-
in {
11+
in
12+
{
1113
imports = [
1214
../shared.nix
1315
];
1416

1517
options.hardware.asus.flow.gv302x.amdgpu = {
16-
recovery.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { default = false; };
17-
sg_display.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // { default = true; };
18-
psr.enable = (mkEnableOption "Enable amdgpu.dcdebugmask=0x10 kernel boot param") // { default = true; };
18+
recovery.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // {
19+
default = false;
20+
};
21+
sg_display.enable = (mkEnableOption "Enable amdgpu.gpu_recovery kernel boot param") // {
22+
default = true;
23+
};
24+
psr.enable = (mkEnableOption "Enable amdgpu.dcdebugmask=0x10 kernel boot param") // {
25+
default = true;
26+
};
1927
};
2028

2129
config = mkMerge [

asus/flow/gv302x/nvidia/default.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{ lib,
1+
{
2+
lib,
23
pkgs,
34
config,
45
...
@@ -7,7 +8,8 @@
78
let
89
inherit (lib) mkDefault;
910

10-
in {
11+
in
12+
{
1113
imports = [
1214
../shared.nix
1315
## "prime.nix" loads this, aleady:
@@ -23,8 +25,6 @@ in {
2325
blacklistedKernelModules = [ "nouveau" ];
2426
};
2527

26-
27-
2828
hardware = {
2929
## Enable the Nvidia card, as well as Prime and Offload:
3030
amdgpu.initrd.enable = mkDefault true;
@@ -49,7 +49,7 @@ in {
4949
};
5050

5151
dynamicBoost.enable = mkDefault true;
52-
52+
5353
};
5454
};
5555
}

asus/flow/gv302x/shared.nix

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
{ config,
1+
{
2+
config,
23
pkgs,
34
lib,
45
...
56
}:
67

78
let
8-
inherit (lib) mkDefault mkEnableOption mkIf mkMerge version versionAtLeast versionOlder;
9+
inherit (lib)
10+
mkDefault
11+
mkEnableOption
12+
mkIf
13+
mkMerge
14+
version
15+
versionAtLeast
16+
;
917

1018
cfg = config.hardware.asus.flow.gv302x;
11-
in {
19+
in
20+
{
1221

1322
imports = [
1423
../../../common/cpu/amd
@@ -26,12 +35,12 @@ in {
2635
# enables it for kernel 6.9.x onwards.
2736
#
2837
# Note: the device name is "ASUS N-KEY Device".
29-
keyboard.autosuspend.enable = (
30-
mkEnableOption "Enable auto-suspend on the internal USB keyboard (ASUS N-KEY Device) on Flow GV302X"
31-
) // {
32-
default = versionAtLeast config.boot.kernelPackages.kernel.version "6.9";
33-
defaultText = lib.literalExpression "lib.versionAtLeast config.boot.kernelPackages.kernel.version \"6.9\"";
34-
};
38+
keyboard.autosuspend.enable =
39+
(mkEnableOption "Enable auto-suspend on the internal USB keyboard (ASUS N-KEY Device) on Flow GV302X")
40+
// {
41+
default = versionAtLeast config.boot.kernelPackages.kernel.version "6.9";
42+
defaultText = lib.literalExpression "lib.versionAtLeast config.boot.kernelPackages.kernel.version \"6.9\"";
43+
};
3544
# The ASUS 8295 ITE device will cause an immediate wake-up when trying to suspend the laptop.
3645
# After the first successful hibernate, it will work as expected, however.
3746
# NOTE: I'm not actually sure what this device, as neither the touchpad nor the M1-M4 keys cause a wake-up.
@@ -63,23 +72,23 @@ in {
6372
evdev:name:*:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:*
6473
KEYBOARD_KEY_ff31007c=f20
6574
'';
66-
};
75+
};
6776
};
6877

6978
#flow devices are 2 in 1 laptops
7079
hardware.sensor.iio.enable = mkDefault true;
7180

7281
}
7382

74-
(mkIf (! cfg.keyboard.autosuspend.enable) {
83+
(mkIf (!cfg.keyboard.autosuspend.enable) {
7584
services.udev.extraRules = ''
7685
# Disable power auto-suspend for the ASUS N-KEY device, i.e. USB Keyboard.
7786
# Otherwise on certain kernel-versions, it will tend to take 1-2 key-presses to wake-up after the device suspends.
7887
ACTION=="add", SUBSYSTEM=="usb", TEST=="power/autosuspend", ATTR{idVendor}=="0b05", ATTR{idProduct}=="19b6", ATTR{power/autosuspend}="-1"
7988
'';
8089
})
8190

82-
(mkIf (! cfg.ite-device.wakeup.enable) {
91+
(mkIf (!cfg.ite-device.wakeup.enable) {
8392
services.udev.extraRules = ''
8493
# Disable power wakeup for the 8295 ITE device.
8594
# Otherwise on certain kernel-versions, it will tend to cause the laptop to immediately wake-up when suspending.

0 commit comments

Comments
 (0)