Skip to content

Commit

Permalink
nixos/ebusd: fix device access
Browse files Browse the repository at this point in the history
  • Loading branch information
Birdy2014 committed Dec 11, 2024
1 parent 79a7ad1 commit e983d9f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nixos/modules/services/home-automation/ebusd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ in

config =
let
usesDev = lib.hasPrefix "/" cfg.device;
usesDev = lib.any (prefix: lib.hasPrefix prefix cfg.device) [
"/"
"ens:/"
"enh:/"
];
in
lib.mkIf cfg.enable {
systemd.services.ebusd = {
Expand Down Expand Up @@ -200,7 +204,9 @@ in

# Hardening
CapabilityBoundingSet = "";
DeviceAllow = lib.optionals usesDev [ cfg.device ];
DeviceAllow = lib.optionals usesDev [
(lib.removePrefix "ens:" (lib.removePrefix "enh:" cfg.device))
];
DevicePolicy = "closed";
LockPersonality = true;
MemoryDenyWriteExecute = false;
Expand Down

0 comments on commit e983d9f

Please sign in to comment.