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