cleverca22
4/21/2017 - 7:03 PM

gistfile1.nix

{ 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}
  '';
}