Skip to content

Commit

Permalink
feat: integrate into t2 module
Browse files Browse the repository at this point in the history
  • Loading branch information
osandell committed Aug 9, 2023
1 parent 85517f7 commit e98474d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 56 deletions.
9 changes: 3 additions & 6 deletions apple/t2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can consult the [wiki](https://wiki.t2linux.org/) for information specific t

## Unlocking Internal iGPU

The `apple-set-os-loader-installer.nix` module serves as an installer for the [`apple-set-os-loader`](https://github.com/Redecorating/apple_set_os-loader). This tool is designed to unlock the internal integrated GPU (iGPU) on certain MacBooks. See https://wiki.t2linux.org/guides/hybrid-graphics/ for more details.
The `apple-set-os-loader-installer` module serves as an installer for the [`apple-set-os-loader`](https://github.com/Redecorating/apple_set_os-loader). This tool is designed to unlock the internal integrated GPU (iGPU) on certain MacBooks. See https://wiki.t2linux.org/guides/hybrid-graphics/ for more details.

### What it Does:

Expand All @@ -22,12 +22,9 @@ Upon activation, this module performs the following:

### How to Implement:

1. **Integrate the apple-set-os-loader installer** into your `configuration.nix`:
1. Add this into your `configuration.nix`:
```
imports = [
...
"${builtins.fetchGit { url = "https://github.com/NixOS/nixos-hardware.git"; }}/apple/t2/apple-set-os-loader-installer.nix"
];
hardware.t2.appleSetOsLoader.enable = true;
```

2. **Rebuild your system**:
Expand Down
41 changes: 0 additions & 41 deletions apple/t2/apple-set-os-loader-installer.nix

This file was deleted.

18 changes: 9 additions & 9 deletions apple/t2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ let
overrideAudioFiles = package: pluginsPath:
package.overrideAttrs (new: old: {
preConfigurePhases = old.preConfigurePhases or [ ] ++ [ "postPatchPhase" ];

postPatchPhase = ''
cp -r ${audioFiles}/files/{profile-sets,paths} ${pluginsPath}/alsa/mixer/
'';
});

pipewirePackage = overrideAudioFiles pkgs.pipewire "spa/plugins/";

# Build apple-os-loader
appleOSLoader = pkgs.callPackage ./apple/os-loader.nix { };

in
{
# For keyboard and touchbar
Expand All @@ -31,12 +36,9 @@ in

hardware.pulseaudio.package = overrideAudioFiles pkgs.pulseaudio "src/modules/";

services.pipewire = rec {
package = overrideAudioFiles pkgs.pipewire "spa/plugins/";

wireplumber.package = pkgs.wireplumber.override {
pipewire = package;
};
services.pipewire.package = pipewirePackage;
services.pipewire.wireplumber.package = pkgs.wireplumber.override {
pipewire = pipewirePackage;
};

# Make sure post-resume.service exists
Expand All @@ -47,9 +49,7 @@ in
serviceConfig.ExecStart = ''${pkgs.systemd}/bin/systemd-inhibit --what=sleep --why="fixing keyboard backlight and touchbar must finish before sleep" --mode=delay ${./fix-keyboard-backlight-and-touchbar.sh}'';
serviceConfig.Type = "oneshot";
description = "reload touchbar driver and restart upower";
# must run at boot (and not too early), and after suspend
wantedBy = [ "display-manager.service" "post-resume.target" ];
# prevent running before suspend
after = [ "post-resume.target" ];
};
}

0 comments on commit e98474d

Please sign in to comment.