about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/programs/pqos-wrapper.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-05-21 11:19:54 +0200
committerAlyssa Ross <hi@alyssa.is>2024-05-21 11:19:54 +0200
commit1f7ea1acad1207378e325dd0d6527a983d7192b5 (patch)
tree38c0985697418e959e9c872b1afde54f9e6880f2 /nixpkgs/nixos/modules/programs/pqos-wrapper.nix
parenta4ffc889571c7100467c7aa1ccae5a4d8373089f (diff)
parent6c0b7a92c30122196a761b440ac0d46d3d9954f1 (diff)
downloadnixlib-1f7ea1acad1207378e325dd0d6527a983d7192b5.tar
nixlib-1f7ea1acad1207378e325dd0d6527a983d7192b5.tar.gz
nixlib-1f7ea1acad1207378e325dd0d6527a983d7192b5.tar.bz2
nixlib-1f7ea1acad1207378e325dd0d6527a983d7192b5.tar.lz
nixlib-1f7ea1acad1207378e325dd0d6527a983d7192b5.tar.xz
nixlib-1f7ea1acad1207378e325dd0d6527a983d7192b5.tar.zst
nixlib-1f7ea1acad1207378e325dd0d6527a983d7192b5.zip
Merge remote-tracking branch 'nixpkgs/nixos-unstable'
Diffstat (limited to 'nixpkgs/nixos/modules/programs/pqos-wrapper.nix')
-rw-r--r--nixpkgs/nixos/modules/programs/pqos-wrapper.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/programs/pqos-wrapper.nix b/nixpkgs/nixos/modules/programs/pqos-wrapper.nix
new file mode 100644
index 000000000000..82023e67a2ae
--- /dev/null
+++ b/nixpkgs/nixos/modules/programs/pqos-wrapper.nix
@@ -0,0 +1,27 @@
+{ config
+, lib
+, pkgs
+, ...
+}:
+let
+  cfg = config.programs.pqos-wrapper;
+in
+{
+  options.programs.pqos-wrapper = {
+    enable = lib.mkEnableOption "PQoS Wrapper for BenchExec";
+    package = lib.mkPackageOption pkgs "pqos-wrapper" { };
+  };
+
+  config = lib.mkIf cfg.enable {
+    hardware.cpu.x86.msr.enable = true;
+
+    security.wrappers.${cfg.package.meta.mainProgram} = {
+      owner = "nobody";
+      group = config.hardware.cpu.x86.msr.group;
+      source = lib.getExe cfg.package;
+      capabilities = "cap_sys_rawio=eip";
+    };
+  };
+
+  meta.maintainers = with lib.maintainers; [ lorenzleutgeb ];
+}