mirror of
https://github.com/lopsided98/nix-ros-overlay.git
synced 2025-06-13 19:24:50 +03:00
nixos: allow passing params to nodes
This commit is contained in:
parent
5a3ba1fb0c
commit
26bcbd3f86
1 changed files with 13 additions and 3 deletions
|
@ -84,6 +84,14 @@ in {
|
||||||
Arguments to pass to the node.
|
Arguments to pass to the node.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
params = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = {};
|
||||||
|
description = ''
|
||||||
|
Key-value parameters to pass to the node.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
|
@ -141,9 +149,11 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.services = mkMerge [
|
systemd.services = mkMerge [
|
||||||
(serviceGenerator (config:
|
(serviceGenerator (config: escapeShellArgs (
|
||||||
escapeShellArgs ([ "${config.env}/bin/rosrun" config.package config.node ] ++ config.args)
|
[ "${config.env}/bin/rosrun" config.package config.node ] ++
|
||||||
) cfg.nodes)
|
(mapAttrsToList (n: v: "${n}:=${v}") config.params) ++
|
||||||
|
config.args
|
||||||
|
)) cfg.nodes)
|
||||||
(serviceGenerator (config: escapeShellArgs (
|
(serviceGenerator (config: escapeShellArgs (
|
||||||
[ "${config.env}/bin/roslaunch" "--wait" ] ++
|
[ "${config.env}/bin/roslaunch" "--wait" ] ++
|
||||||
config.roslaunchArgs ++
|
config.roslaunchArgs ++
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue