2016-04-09 20:22:16 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
2016-09-15 15:23:52 +02:00
|
|
|
meta = {
|
|
|
|
maintainers = [ maintainers.joachifm ];
|
|
|
|
doc = ./hidepid.xml;
|
|
|
|
};
|
2016-04-09 20:22:16 +02:00
|
|
|
|
2016-09-15 15:23:52 +02:00
|
|
|
options = {
|
|
|
|
security.hideProcessInformation = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Restrict process information to the owning user.
|
|
|
|
'';
|
|
|
|
};
|
2016-04-09 20:22:16 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf config.security.hideProcessInformation {
|
|
|
|
users.groups.proc.gid = config.ids.gids.proc;
|
|
|
|
|
2016-08-31 16:16:30 +02:00
|
|
|
boot.specialFileSystems."/proc".options = [ "hidepid=2" "gid=${toString config.ids.gids.proc}" ];
|
2016-04-09 20:22:16 +02:00
|
|
|
};
|
|
|
|
}
|