fix cyclic dependencies in sysd

This commit is contained in:
Grimmauld 2024-10-27 13:57:57 +01:00
parent ec80dc24fb
commit 48df7d2533
Signed by: Grimmauld
GPG Key ID: C2946668769F91FB

View File

@ -5,21 +5,29 @@
...
}:
let
inherit (lib) getExe;
inherit (lib) getExe mkIf;
aa-alias-manager = pkgs.callPackage ./aa-alias-manager-package.nix { };
alias_dir = "/run/aliases.d";
in
{
config = {
config = mkIf config.security.apparmor.enable {
security.apparmor.includes."tunables/alias.d/store" = ''
include if exists "${alias_dir}"
'';
systemd.services.aa-alias-setup = {
after = [ "local-fs.target" ];
before = [ "apparmor.service" ];
requiredBy = [ "apparmor.service" ];
path = [ config.nix.package ]; # respect the users choice to use alternative nix implementations
unitConfig = {
Description = "Initialize alias rules required for AppArmor policies";
DefaultDependencies = "no";
ConditionSecurity = "apparmor";
};
serviceConfig = {
Type = "oneshot";
ExecStart = "${getExe aa-alias-manager} -o ${alias_dir} -p ${./aa-alias-patterns.json}";