Merge branch 'amd_s2idle' into nix
This commit is contained in:
commit
d25e9173dd
@ -9,6 +9,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./roles/2ship2harkinian
|
./roles/2ship2harkinian
|
||||||
./roles/alacritty
|
./roles/alacritty
|
||||||
|
./roles/amd_s2idle
|
||||||
./roles/ansible
|
./roles/ansible
|
||||||
./roles/ares
|
./roles/ares
|
||||||
./roles/bluetooth
|
./roles/bluetooth
|
||||||
|
|||||||
@ -59,6 +59,7 @@
|
|||||||
# services.fstrim.enable = lib.mkDefault true;
|
# services.fstrim.enable = lib.mkDefault true;
|
||||||
|
|
||||||
me.alacritty.enable = true;
|
me.alacritty.enable = true;
|
||||||
|
me.amd_s2idle.enable = true;
|
||||||
me.ansible.enable = true;
|
me.ansible.enable = true;
|
||||||
me.ares.enable = true;
|
me.ares.enable = true;
|
||||||
me.bluetooth.enable = true;
|
me.bluetooth.enable = true;
|
||||||
|
|||||||
@ -54,6 +54,7 @@
|
|||||||
me.rpcs3.config.Core."Use LLVM CPU" = "znver4";
|
me.rpcs3.config.Core."Use LLVM CPU" = "znver4";
|
||||||
|
|
||||||
me.alacritty.enable = true;
|
me.alacritty.enable = true;
|
||||||
|
me.amd_s2idle.enable = true;
|
||||||
me.ansible.enable = true;
|
me.ansible.enable = true;
|
||||||
me.ares.enable = true;
|
me.ares.enable = true;
|
||||||
me.bluetooth.enable = true;
|
me.bluetooth.enable = true;
|
||||||
|
|||||||
76
nix/configuration/roles/amd_s2idle/cysystemd.nix
Normal file
76
nix/configuration/roles/amd_s2idle/cysystemd.nix
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
# unpackPhase
|
||||||
|
# patchPhase
|
||||||
|
# configurePhase
|
||||||
|
# buildPhase
|
||||||
|
# checkPhase
|
||||||
|
# installPhase
|
||||||
|
# fixupPhase
|
||||||
|
# installCheckPhase
|
||||||
|
# distPhase
|
||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
pkgs,
|
||||||
|
sqlite,
|
||||||
|
makeWrapper,
|
||||||
|
lib,
|
||||||
|
python3,
|
||||||
|
systemd,
|
||||||
|
# setuptools,
|
||||||
|
# cython,
|
||||||
|
pkg-config,
|
||||||
|
# python3Packages,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
version = "1.6.3";
|
||||||
|
in
|
||||||
|
python3.pkgs.buildPythonPackage {
|
||||||
|
pname = "cysystemd";
|
||||||
|
version = version;
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
# format = "pyproject";
|
||||||
|
|
||||||
|
build-system = [
|
||||||
|
python3.pkgs.setuptools
|
||||||
|
python3.pkgs.cython
|
||||||
|
];
|
||||||
|
buildInputs = [ systemd ];
|
||||||
|
nativeBuildInputs = with python3.pkgs; [
|
||||||
|
# setuptools
|
||||||
|
# setuptools-git-versioning
|
||||||
|
# setuptools-git
|
||||||
|
# pyudev
|
||||||
|
# pkgs.systemd
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
propagatedBuildInputs = with python3.pkgs; [
|
||||||
|
# pyudev
|
||||||
|
# pandas
|
||||||
|
# jinja2
|
||||||
|
# tabulate
|
||||||
|
# seaborn
|
||||||
|
# cysystemd
|
||||||
|
# jinja2
|
||||||
|
# matplotlib
|
||||||
|
# seaborn
|
||||||
|
];
|
||||||
|
src = pkgs.fetchgit {
|
||||||
|
url = "https://github.com/mosquito/cysystemd.git";
|
||||||
|
tag = version;
|
||||||
|
sha256 = "sha256-xumrQgoKfFeKdRQUIYXXiXEcNd76i4wo/EIDm8BN7oU=";
|
||||||
|
# leaveDotGit = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# postPatch = ''
|
||||||
|
# substituteInPlace pyproject.toml \
|
||||||
|
# --replace-fail ', "setuptools-git-versioning>=2.0,<3"' ""
|
||||||
|
# '';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "systemd wrapper on Cython";
|
||||||
|
homepage = "https://github.com/mosquito/cysystemd";
|
||||||
|
license = licenses.asl20;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
||||||
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
|
||||||
|
# ]))
|
||||||
|
# ]
|
||||||
|
# }
|
||||||
|
# '';
|
||||||
|
# };
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
70
nix/configuration/roles/amd_s2idle/package.nix
Normal file
70
nix/configuration/roles/amd_s2idle/package.nix
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
# unpackPhase
|
||||||
|
# patchPhase
|
||||||
|
# configurePhase
|
||||||
|
# buildPhase
|
||||||
|
# checkPhase
|
||||||
|
# installPhase
|
||||||
|
# fixupPhase
|
||||||
|
# installCheckPhase
|
||||||
|
# distPhase
|
||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
pkgs,
|
||||||
|
sqlite,
|
||||||
|
makeWrapper,
|
||||||
|
lib,
|
||||||
|
python3,
|
||||||
|
callPackage,
|
||||||
|
# python3Packages,
|
||||||
|
acpica-tools,
|
||||||
|
ethtool,
|
||||||
|
libdisplay-info,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
version = "0.2.7";
|
||||||
|
in
|
||||||
|
python3.pkgs.buildPythonApplication {
|
||||||
|
pname = "amd-debug-tools";
|
||||||
|
version = version;
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
# name = "amd-debug-tools";
|
||||||
|
# format = "pyproject";
|
||||||
|
nativeBuildInputs = with python3.pkgs; [
|
||||||
|
setuptools
|
||||||
|
setuptools-git-versioning
|
||||||
|
setuptools-git
|
||||||
|
pyudev
|
||||||
|
];
|
||||||
|
propagatedBuildInputs = with python3.pkgs; [
|
||||||
|
(callPackage ./cysystemd.nix { })
|
||||||
|
jinja2
|
||||||
|
matplotlib
|
||||||
|
pandas
|
||||||
|
pyudev
|
||||||
|
seaborn
|
||||||
|
tabulate
|
||||||
|
acpica-tools
|
||||||
|
ethtool
|
||||||
|
libdisplay-info
|
||||||
|
];
|
||||||
|
src = pkgs.fetchgit {
|
||||||
|
url = "https://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git";
|
||||||
|
tag = version;
|
||||||
|
sha256 = "sha256-6X9cUKN0BkkKcYGU+YJYCGT+l5iUZDN+D8Fqq/ns98Q=";
|
||||||
|
leaveDotGit = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace pyproject.toml \
|
||||||
|
--replace-fail ', "setuptools-git-versioning>=2.0,<3"' ""
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Debug tools for AMD zen systems";
|
||||||
|
homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git/";
|
||||||
|
license = licenses.mit;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user