mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 22:36:23 +01:00
27 lines
686 B
Nix
27 lines
686 B
Nix
{ config, lib, ... }:
|
|
with lib;
|
|
|
|
{
|
|
meta = {
|
|
maintainers = [ maintainers.joachifm ];
|
|
doc = ./hidepid.xml;
|
|
};
|
|
|
|
options = {
|
|
security.hideProcessInformation = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = ''
|
|
Restrict process information to the owning user.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf config.security.hideProcessInformation {
|
|
users.groups.proc.gid = config.ids.gids.proc;
|
|
users.groups.proc.members = [ "polkituser" ];
|
|
|
|
boot.specialFileSystems."/proc".options = [ "hidepid=2" "gid=${toString config.ids.gids.proc}" ];
|
|
systemd.services.systemd-logind.serviceConfig.SupplementaryGroups = [ "proc" ];
|
|
};
|
|
}
|