at 23.05-pre 694 B view raw
1{ config, pkgs, lib, ... }: 2 3with lib; 4 5let cfg = config.programs.noisetorch; 6in 7{ 8 options.programs.noisetorch = { 9 enable = mkEnableOption (lib.mdDoc "noisetorch + setcap wrapper"); 10 11 package = mkOption { 12 type = types.package; 13 default = pkgs.noisetorch; 14 defaultText = literalExpression "pkgs.noisetorch"; 15 description = lib.mdDoc '' 16 The noisetorch package to use. 17 ''; 18 }; 19 }; 20 21 config = mkIf cfg.enable { 22 security.wrappers.noisetorch = { 23 owner = "root"; 24 group = "root"; 25 capabilities = "cap_sys_resource=+ep"; 26 source = "${cfg.package}/bin/noisetorch"; 27 }; 28 environment.systemPackages = [ cfg.package ]; 29 }; 30}