{ pkgs, ... }:
let
script1 = pkgs.writeScript "brightnessscript" ''
#!/bin/sh
your script here
'';
script2 = pkgs.writeScriptBin "brightness" ''
#!/bin/sh
sudo ${script1}
'';
in {
environment.systemPackages = [ script2 ];
security.sudo.extraConfig = ''
infinisil ALL=(root) NOPASSWD: ${script1}
'';
}