feat: move to Replaced rppal with tokio-gpiod and other rust things
This commit is contained in:
parent
b2d9406831
commit
773c14e32f
6 changed files with 106 additions and 84 deletions
27
pi/flake.nix
27
pi/flake.nix
|
|
@ -97,19 +97,6 @@
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.users.noisebell = {
|
||||
isSystemUser = true;
|
||||
group = "noisebell";
|
||||
extraGroups = [ "gpio" ];
|
||||
};
|
||||
users.groups.noisebell = {};
|
||||
users.groups.gpio = {};
|
||||
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="gpiomem", GROUP="gpio", MODE="0660"
|
||||
KERNEL=="gpiochip[0-9]*", GROUP="gpio", MODE="0660"
|
||||
'';
|
||||
|
||||
systemd.services.noisebell = let
|
||||
bin = "${noisebell.packages.aarch64-linux.default}/bin/noisebell";
|
||||
in {
|
||||
|
|
@ -144,20 +131,6 @@
|
|||
WatchdogSec = cfg.watchdogSecs;
|
||||
Restart = "on-failure";
|
||||
RestartSec = cfg.restartDelaySecs;
|
||||
User = "noisebell";
|
||||
Group = "noisebell";
|
||||
AmbientCapabilities = lib.optionals (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
|
||||
NoNewPrivileges = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
PrivateTmp = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectControlGroups = true;
|
||||
RestrictSUIDSGID = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
DevicePolicy = "closed";
|
||||
DeviceAllow = [ "char-gpiomem rw" "char-gpiochip rw" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue