Update nosetuid

This commit is contained in:
2023-10-23 14:52:40 +03:00
parent 8ce471ee1e
commit 45d582c219

View File

@@ -1,12 +1,12 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.local.packages.linuxcnc; cfg = config.local.packages.linuxcnc-with-ethercat;
inherit (builtins) filter map pathExists listToAttrs; inherit (builtins) filter map pathExists listToAttrs;
in { in {
options.local.packages.linuxcnc.enable = lib.mkEnableOption "Enable linuxcnc"; options.local.packages.linuxcnc.enable = lib.mkEnableOption "Enable linuxcnc";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ linuxcnc ]; environment.systemPackages = with pkgs; [ linuxcnc-with-ethercat ];
security.wrappers = listToAttrs (map (f: { security.wrappers = listToAttrs (map (f: {
name = f; name = f;
@@ -14,8 +14,8 @@ in {
setuid = true; setuid = true;
owner = "root"; owner = "root";
group = "root"; group = "root";
source = "${pkgs.linuxcnc}/bin/${f}-nosetuid"; source = "${pkgs.linuxcnc-with-ethercat}/bin/${f}-nosetuid";
}; };
}) (filter (f: pathExists "${pkgs.linuxcnc}/bin/${f}-nosetuid") pkgs.linuxcnc.setuidApps)); }) (filter (f: pathExists "${pkgs.linuxcnc-with-ethercat}/bin/${f}-nosetuid") pkgs.linuxcnc-with-ethercat.setuidApps));
}; };
} }