.files/nix/nixosModules/common/sudo-conf.nix
Léana 江 ebf8468807
tree-wide: format with nixfmt
Another saturday another useless formatter change.
It's my dotfiles, after all

alejandra doesn't handle c-style inline comments well.
2025-11-08 10:15:58 +08:00

27 lines
830 B
Nix

{ pkgs, ... }:
{
security.sudo.enable = false;
environment.systemPackages = [
pkgs.doas-sudo-shim
];
security.doas = {
enable = true;
extraRules = [
{
# Invoke just with doas directly as a nixos-rebuild helper
#
# Specifiying just here is impractical, because
# - Use absolute path?
# Works only for a specific version of just binary.
# Also, for some reason, the rule won't match.
# - Use relative path?
# doas's docs says it searches in a "limited subset of PATH" if it's relative.
# I suspect that it doesn't search the PATH added ad-hoc by the nix-shell, also not a good solution.
# Also, for some reason, the rule won't match.
users = [ ":wheel" ];
setEnv = [ "PATH" ];
}
];
};
}