mirror of
https://github.com/lopsided98/nix-ros-overlay.git
synced 2025-06-11 18: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.
|
||||
'';
|
||||
};
|
||||
|
||||
params = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {};
|
||||
description = ''
|
||||
Key-value parameters to pass to the node.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
|
@ -141,9 +149,11 @@ in {
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services = mkMerge [
|
||||
(serviceGenerator (config:
|
||||
escapeShellArgs ([ "${config.env}/bin/rosrun" config.package config.node ] ++ config.args)
|
||||
) cfg.nodes)
|
||||
(serviceGenerator (config: escapeShellArgs (
|
||||
[ "${config.env}/bin/rosrun" config.package config.node ] ++
|
||||
(mapAttrsToList (n: v: "${n}:=${v}") config.params) ++
|
||||
config.args
|
||||
)) cfg.nodes)
|
||||
(serviceGenerator (config: escapeShellArgs (
|
||||
[ "${config.env}/bin/roslaunch" "--wait" ] ++
|
||||
config.roslaunchArgs ++
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue