blob: 424d9d72e5334087df7476ac9496f2cd3eb6a3d8 [file] [log] [blame]
# SPDX-FileCopyrightText: 2024 Auxolotl Infrastructure Contributors
# SPDX-FileCopyrightText: 2024 Clicks Codes
#
# SPDX-License-Identifier: GPL-3.0-only
{
lib,
pkgs,
config,
...
}:
let
cfg = config.clicks.security.doas;
in
{
options.clicks.security.doas = {
enable = lib.mkEnableOption "doas";
};
config = lib.mkIf cfg.enable {
security.sudo.enable = false;
security.doas = {
enable = true;
extraRules = [
{
users = config.clicks.users.deployers;
noPass = true;
keepEnv = true;
}
];
};
environment.shellAliases = {
sudo = "${config.security.wrapperDir}/${config.security.wrappers.doas.program}";
};
};
}