Create env for linuxcnc
This commit is contained in:
@@ -2,11 +2,15 @@
|
|||||||
let
|
let
|
||||||
cfg = config.local.packages.linuxcnc;
|
cfg = config.local.packages.linuxcnc;
|
||||||
inherit (builtins) filter map pathExists listToAttrs;
|
inherit (builtins) filter map pathExists listToAttrs;
|
||||||
|
linuxcncEnv = pkgs.buildEnv {
|
||||||
|
name = "linuxcnc-env";
|
||||||
|
paths = with pkgs; [ linuxcnc hal-cia402 linuxcnc-ethercat ];
|
||||||
|
};
|
||||||
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; [ linuxcncEnv ];
|
||||||
|
|
||||||
security.wrappers = listToAttrs (map (f: {
|
security.wrappers = listToAttrs (map (f: {
|
||||||
name = f;
|
name = f;
|
||||||
@@ -14,8 +18,8 @@ in {
|
|||||||
setuid = true;
|
setuid = true;
|
||||||
owner = "root";
|
owner = "root";
|
||||||
group = "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