perf enable

This commit is contained in:
Nathan McCarty 2023-06-08 22:05:35 -04:00
parent 431d471283
commit 93177aa622
Signed by: thatonelutenist
SSH Key Fingerprint: SHA256:hwQEcmak9E6sdU9bXc98RHw/Xd1AhpB5HZT7ZSVJkRM
2 changed files with 11 additions and 0 deletions

View File

@ -26,6 +26,16 @@ with lib; {
let unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system};
in unstable.linuxKernel.packages.linux_lqx;
})
(mkIf ((!config.nathan.config.harden) && config.nathan.config.isDesktop
&& config.nathan.programs.perf) {
# Install perf and related tools
environment.systemPackages =
let unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system};
in [ unstable.linuxKernel.packages.linux_lqx.perf ];
# Allow users to use it
boot.kernel.sysctl."kernel.perf_event_paranoid" = -1;
boot.kernel.sysctl."kernel.kptr_restrict" = lib.mkForce 0;
})
(mkIf config.nathan.config.isDesktop {
# Setup frequency scaling
powerManagement = {

View File

@ -118,6 +118,7 @@ in {
# Enabled by default on desktop
binfmt = mkDefaultOption "binfmt" config.nathan.config.isDesktop;
};
perf = mkDefaultOption "perf" config.nathan.config.isDesktop;
};
# Control enabling of hardware support
hardware = {