forked from mirrors/nixpkgs
Cleanup AppArmor module
Remove excessive whitespace & comment sections
This commit is contained in:
parent
7a9a24a95e
commit
532337d673
|
@ -6,37 +6,26 @@ let
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
#### interface
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
security.apparmor = {
|
security.apparmor = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Enable the AppArmor Mandatory Access Control system.";
|
description = "Enable the AppArmor Mandatory Access Control system.";
|
||||||
};
|
};
|
||||||
|
|
||||||
profiles = mkOption {
|
profiles = mkOption {
|
||||||
type = types.listOf types.path;
|
type = types.listOf types.path;
|
||||||
default = [];
|
default = [];
|
||||||
description = "List of files containing AppArmor profiles.";
|
description = "List of files containing AppArmor profiles.";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#### implementation
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ pkgs.apparmor-utils ];
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.apparmor-utils
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.services.apparmor = {
|
systemd.services.apparmor = {
|
||||||
wantedBy = [ "local-fs.target" ];
|
wantedBy = [ "local-fs.target" ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = "yes";
|
RemainAfterExit = "yes";
|
||||||
|
@ -50,12 +39,11 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
security.pam.services.apparmor.text = ''
|
security.pam.services.apparmor.text = ''
|
||||||
## The AppArmor service changes hats according to order: first try
|
## AppArmor changes hats according to `order`: first try user, then
|
||||||
## user, then group, and finally fall back to a hat called "DEFAULT"
|
## group, and finally fall back to a hat called "DEFAULT"
|
||||||
##
|
##
|
||||||
## For now, enable debugging as this is an experimental feature.
|
## For now, enable debugging as this is an experimental feature.
|
||||||
session optional ${pkgs.apparmor-pam}/lib/security/pam_apparmor.so order=user,group,default debug
|
session optional ${pkgs.apparmor-pam}/lib/security/pam_apparmor.so order=user,group,default debug
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue