blob: fddd3630d4cd914b3e2526831bcff5528ae7768f [file] [log] [blame]
Skyler Grey1fe0da32023-02-26 13:06:21 +00001{ pkgs, system, username, config, ... }: {
2 config = {
3 security.apparmor = {
4 enable = true;
5
6 packages = [ pkgs.apparmor-profiles ];
7
8 killUnconfinedConfinables = true;
9
10 policies = {
11 # TODO: Refactor this into a directory, ideally we'll have too many
12 # profiles for this to be just here. Perhaps look at neovim for an
13 # example? Explore if we could put these outside of nix files so we can
14 # use syntax highlighting
15
16 default_deny = {
17 profile = ''
18 profile default_deny /** { }
19 '';
20 enforce = false;
21 enable = true;
22 };
23
24 sudo = {
25 profile = ''
26 ${config.security.wrapperDir}/sudo {
27 file rwlkUx,
28 }
29 '';
30 };
31 };
32 };
33
34 services.dbus.apparmor = "required";
35 };
36}