summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2021-04-24 11:24:26 +0000
committerGitHub <noreply@github.com>2021-04-24 11:24:26 +0000
commitd04f1c4314e6e54e2b6d86055d181f5de5f98468 (patch)
treea329968942dd00f7c9cdd0e12f6174a7bf1ab61d /nixos/modules/config
parent6b24bc6db805f4da8f66ef76ee71be5093347be1 (diff)
parentb42a0e205d567b96970386a7cd442dc4816bd840 (diff)
downloadnixpkgs-d04f1c4314e6e54e2b6d86055d181f5de5f98468.tar
nixpkgs-d04f1c4314e6e54e2b6d86055d181f5de5f98468.tar.gz
nixpkgs-d04f1c4314e6e54e2b6d86055d181f5de5f98468.tar.bz2
nixpkgs-d04f1c4314e6e54e2b6d86055d181f5de5f98468.tar.lz
nixpkgs-d04f1c4314e6e54e2b6d86055d181f5de5f98468.tar.xz
nixpkgs-d04f1c4314e6e54e2b6d86055d181f5de5f98468.tar.zst
nixpkgs-d04f1c4314e6e54e2b6d86055d181f5de5f98468.zip
Merge pull request #101071 from ju1m/apparmor
apparmor: try again to fix and improve
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/fonts/fontconfig.nix34
-rw-r--r--nixos/modules/config/malloc.nix7
2 files changed, 41 insertions, 0 deletions
diff --git a/nixos/modules/config/fonts/fontconfig.nix b/nixos/modules/config/fonts/fontconfig.nix
index 6e7b8c4b88a..72827c5abaa 100644
--- a/nixos/modules/config/fonts/fontconfig.nix
+++ b/nixos/modules/config/fonts/fontconfig.nix
@@ -448,6 +448,40 @@ in
     (mkIf cfg.enable {
       environment.systemPackages    = [ pkgs.fontconfig ];
       environment.etc.fonts.source  = "${fontconfigEtc}/etc/fonts/";
+      security.apparmor.includes."abstractions/fonts" = ''
+        # fonts.conf
+        r ${pkg.out}/etc/fonts/fonts.conf,
+
+        # fontconfig default config files
+        r ${pkg.out}/etc/fonts/conf.d/*.conf,
+
+        # 00-nixos-cache.conf
+        r ${cacheConf},
+
+        # 10-nixos-rendering.conf
+        r ${renderConf},
+
+        # 50-user.conf
+        ${optionalString cfg.includeUserConf ''
+        r ${pkg.out}/etc/fonts/conf.d.bak/50-user.conf,
+        ''}
+
+        # local.conf (indirect priority 51)
+        ${optionalString (cfg.localConf != "") ''
+        r ${localConf},
+        ''}
+
+        # 52-nixos-default-fonts.conf
+        r ${defaultFontsConf},
+
+        # 53-no-bitmaps.conf
+        r ${rejectBitmaps},
+
+        ${optionalString (!cfg.allowType1) ''
+        # 53-nixos-reject-type1.conf
+        r ${rejectType1},
+        ''}
+      '';
     })
     (mkIf cfg.enable {
       fonts.fontconfig.confPackages = [ confPkg ];
diff --git a/nixos/modules/config/malloc.nix b/nixos/modules/config/malloc.nix
index a3eb55d8a42..fc35993b5a8 100644
--- a/nixos/modules/config/malloc.nix
+++ b/nixos/modules/config/malloc.nix
@@ -87,5 +87,12 @@ in
     environment.etc."ld-nix.so.preload".text = ''
       ${providerLibPath}
     '';
+    security.apparmor.includes = {
+      "abstractions/base" = ''
+        r /etc/ld-nix.so.preload,
+        r ${config.environment.etc."ld-nix.so.preload".source},
+        mr ${providerLibPath},
+      '';
+    };
   };
 }