2021-02-22 18:02:35 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let cfg = config.programs.noisetorch;
|
|
|
|
in {
|
|
|
|
options.programs.noisetorch = {
|
|
|
|
enable = mkEnableOption "noisetorch + setcap wrapper";
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.noisetorch;
|
2021-10-03 18:06:03 +02:00
|
|
|
defaultText = literalExpression "pkgs.noisetorch";
|
2021-02-22 18:02:35 +01:00
|
|
|
description = ''
|
|
|
|
The noisetorch package to use.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
security.wrappers.noisetorch = {
|
2021-09-12 18:53:48 +02:00
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
2021-02-22 18:02:35 +01:00
|
|
|
capabilities = "cap_sys_resource=+ep";
|
2021-09-12 18:53:48 +02:00
|
|
|
source = "${cfg.package}/bin/noisetorch";
|
2021-02-22 18:02:35 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|