Create env for linuxcnc
This commit is contained in:
@@ -2,11 +2,15 @@
|
||||
let
|
||||
cfg = config.local.packages.linuxcnc;
|
||||
inherit (builtins) filter map pathExists listToAttrs;
|
||||
linuxcncEnv = pkgs.buildEnv {
|
||||
name = "linuxcnc-env";
|
||||
paths = with pkgs; [ linuxcnc hal-cia402 linuxcnc-ethercat ];
|
||||
};
|
||||
in {
|
||||
options.local.packages.linuxcnc.enable = lib.mkEnableOption "Enable linuxcnc";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ linuxcnc ];
|
||||
environment.systemPackages = with pkgs; [ linuxcncEnv ];
|
||||
|
||||
security.wrappers = listToAttrs (map (f: {
|
||||
name = f;
|
||||
@@ -14,8 +18,8 @@ in {
|
||||
setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = "${pkgs.linuxcnc}/bin/${f}-nosetuid";
|
||||
source = "${linuxcncEnv.linuxcnc}/bin/${f}-nosetuid";
|
||||
};
|
||||
}) (filter (f: pathExists "${pkgs.linuxcnc}/bin/${f}-nosetuid") pkgs.linuxcnc.setuidApps));
|
||||
}) (filter (f: pathExists "${linuxcncEnv.linuxcnc}/bin/${f}-nosetuid") linuxcncEnv.linuxcnc.setuidApps));
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user