about summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
authorHerwig Hochleitner <herwig@bendlas.net>2018-02-09 23:13:38 +0100
committerHerwig Hochleitner <hhochleitner@gmail.com>2018-02-15 09:10:32 +0100
commit28875192ae411f6a44ac4f4392928b65005d11aa (patch)
tree623a36001c3fe3caf22dbfb1120b0ef1558a26b7 /nixos/modules/programs
parent3027b80f1df952a7d365f7ab7ad7cc483a03a1e7 (diff)
downloadnixlib-28875192ae411f6a44ac4f4392928b65005d11aa.tar
nixlib-28875192ae411f6a44ac4f4392928b65005d11aa.tar.gz
nixlib-28875192ae411f6a44ac4f4392928b65005d11aa.tar.bz2
nixlib-28875192ae411f6a44ac4f4392928b65005d11aa.tar.lz
nixlib-28875192ae411f6a44ac4f4392928b65005d11aa.tar.xz
nixlib-28875192ae411f6a44ac4f4392928b65005d11aa.tar.zst
nixlib-28875192ae411f6a44ac4f4392928b65005d11aa.zip
programs.systemtap: add nixos option for installing systemtap
also enables debug feature on kernel
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r--nixos/modules/programs/systemtap.nix28
1 files changed, 28 insertions, 0 deletions
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 <command>systemtap</command> 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
+    ];
+  };
+
+}