summaryrefslogtreecommitdiff
path: root/modules/doas.nix
blob: 2af324e7cbd56be899d2c70716e85d2e8ec1381a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{ lib, config, ... }: {
	options = {
		doas.enable = lib.mkEnableOption "enables doas";
		sudo.enable = lib.mkEnableOption "enables sudo";
	};

	config = lib.mkIf config.doas.enable {
		security.doas.enable = true;
		security.sudo.enable = config.sudo.enable;
		security.doas.extraRules = [{
			groups = ["wheel"];
			keepEnv = true;
			noPass = true;
		}];
	};
}