From 28875192ae411f6a44ac4f4392928b65005d11aa Mon Sep 17 00:00:00 2001 From: Herwig Hochleitner Date: Fri, 9 Feb 2018 23:13:38 +0100 Subject: [PATCH] programs.systemtap: add nixos option for installing systemtap also enables debug feature on kernel --- nixos/modules/module-list.nix | 1 + nixos/modules/programs/systemtap.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 nixos/modules/programs/systemtap.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 751465c96937..35f5e87d7e5e 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -104,6 +104,7 @@ ./programs/ssh.nix ./programs/ssmtp.nix ./programs/sysdig.nix + ./programs/systemtap.nix ./programs/sway.nix ./programs/thefuck.nix ./programs/tmux.nix diff --git a/nixos/modules/programs/systemtap.nix b/nixos/modules/programs/systemtap.nix new file mode 100644 index 000000000000..fd84732cd412 --- /dev/null +++ b/nixos/modules/programs/systemtap.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let cfg = config.programs.systemtap; +in { + + options = { + programs.systemtap = { + enable = mkOption { + default = false; + description = '' + Install systemtap along with necessary kernel options. + ''; + }; + }; + }; + config = mkIf cfg.enable { + system.requiredKernelConfig = with config.lib.kernelConfig; [ + (isYes "DEBUG") + ]; + boot.kernel.features.debug = true; + environment.systemPackages = [ + config.boot.kernelPackages.systemtap + ]; + }; + +}