60 lines
1.7 KiB
Nix
Raw Normal View History

{
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
# ]))
# ]
# }
# '';
# };
}
)
];
}
]
);
}