Add amd_s2idle script for debugging s2idle.
This commit is contained in:
parent
748584c78e
commit
b224a78b89
@ -9,6 +9,7 @@
|
||||
imports = [
|
||||
./roles/2ship2harkinian
|
||||
./roles/alacritty
|
||||
./roles/amd_s2idle
|
||||
./roles/ansible
|
||||
./roles/ares
|
||||
./roles/bluetooth
|
||||
|
@ -59,6 +59,7 @@
|
||||
# services.fstrim.enable = lib.mkDefault true;
|
||||
|
||||
me.alacritty.enable = true;
|
||||
me.amd_s2idle.enable = true;
|
||||
me.ansible.enable = true;
|
||||
me.ares.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
|
@ -54,6 +54,7 @@
|
||||
me.rpcs3.config.Core."Use LLVM CPU" = "znver4";
|
||||
|
||||
me.alacritty.enable = true;
|
||||
me.amd_s2idle.enable = true;
|
||||
me.ansible.enable = true;
|
||||
me.ares.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
|
59
nix/configuration/roles/amd_s2idle/default.nix
Normal file
59
nix/configuration/roles/amd_s2idle/default.nix
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
amd_s2idle.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install amd_s2idle.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.amd_s2idle.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
amd_s2idle
|
||||
];
|
||||
nixpkgs.overlays = [
|
||||
(
|
||||
final: prev:
|
||||
let
|
||||
innerPackage = (final.callPackage ./package.nix { });
|
||||
in
|
||||
{
|
||||
amd_s2idle = innerPackage;
|
||||
# amd_s2idle = final.buildEnv {
|
||||
# name = innerPackage.name;
|
||||
# paths = [
|
||||
# innerPackage
|
||||
# ];
|
||||
# nativeBuildInputs = [ final.makeWrapper ];
|
||||
# postBuild = ''
|
||||
# wrapProgram $out/bin/amd_s2idle --prefix PATH : ${
|
||||
# lib.makeBinPath [
|
||||
# (final.python3.withPackages (python-pkgs: [
|
||||
# python-pkgs.distro # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||
# python-pkgs.pyudev # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||
# python-pkgs.systemd # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||
# python-pkgs.packaging # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||
# ]))
|
||||
# ]
|
||||
# }
|
||||
# '';
|
||||
# };
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
54
nix/configuration/roles/amd_s2idle/package.nix
Normal file
54
nix/configuration/roles/amd_s2idle/package.nix
Normal file
@ -0,0 +1,54 @@
|
||||
# unpackPhase
|
||||
# patchPhase
|
||||
# configurePhase
|
||||
# buildPhase
|
||||
# checkPhase
|
||||
# installPhase
|
||||
# fixupPhase
|
||||
# installCheckPhase
|
||||
# distPhase
|
||||
{
|
||||
stdenv,
|
||||
pkgs,
|
||||
sqlite,
|
||||
makeWrapper,
|
||||
lib,
|
||||
python3,
|
||||
...
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "amd_s2idle";
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://gitlab.freedesktop.org/drm/amd.git";
|
||||
rev = "0f486d26c05044cebe2c61143bfd56899eef716f";
|
||||
sha256 = "sha256-Q1QTaxuvtVKEizO7OHudhcZzxrgcYRgGJOvLDQPMGZ0=";
|
||||
};
|
||||
buildInputs = [ ];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
phases = [
|
||||
"installPhase"
|
||||
# "fixupPhase"
|
||||
];
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
cp $src/scripts/amd_s2idle.py $out/bin/amd_s2idle
|
||||
runHook postInstall
|
||||
'';
|
||||
postInstall = ''
|
||||
sed -i 's@#!/usr/bin/python3@#!/usr/bin/env python3@g' $out/bin/amd_s2idle
|
||||
wrapProgram $out/bin/amd_s2idle --prefix PATH : ${
|
||||
lib.makeBinPath [
|
||||
(python3.withPackages (python-pkgs: [
|
||||
python-pkgs.distro # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||
python-pkgs.pyudev # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||
python-pkgs.systemd # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||
python-pkgs.packaging # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
|
||||
]))
|
||||
]
|
||||
}
|
||||
'';
|
||||
# fixupPhase = ''
|
||||
# patchShebangs $out/bin/.amd_s2idle-wrapped
|
||||
# '';
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user