Compare commits
2 commits
b2f706bf83
...
48df7d2533
Author | SHA1 | Date | |
---|---|---|---|
48df7d2533 | |||
ec80dc24fb |
1 changed files with 23 additions and 7 deletions
|
@ -1,17 +1,33 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) getExe;
|
||||
aa-alias-manager = pkgs.callPackage ./aa-alias-manager-package.nix {};
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) getExe mkIf;
|
||||
aa-alias-manager = pkgs.callPackage ./aa-alias-manager-package.nix { };
|
||||
alias_dir = "/run/aliases.d";
|
||||
in {
|
||||
config = {
|
||||
in
|
||||
{
|
||||
config = mkIf config.security.apparmor.enable {
|
||||
security.apparmor.includes."tunables/alias.d/store" = ''
|
||||
include if exists "${alias_dir}"
|
||||
'';
|
||||
|
||||
systemd.services.aa-alias-setup = {
|
||||
wantedBy = [ "apparmor.service" ];
|
||||
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}";
|
||||
|
|
Loading…
Reference in a new issue