git.iko.soy/typeable/nixpkgs
on master help sign in
tinc service: add CLI tools to the $PATH

Now user can execute e.g. "sudo tinc.netname dump nodes"

commit00512470ec241949148b61e1c120fa76d685cf9a authorVolth <volth@webmaster.ms> dateFri 21 Jul 2017, 13:43 (9 years ago) parentb33b400
1 file changed+13
nixos/modules/services/networking/tinc.nix+13
nixos/modules/services/networking/tinc.nix+13
@@ -194,6 +194,19 @@ in
194194 })
195195 );
196196
197+ environment.systemPackages = let
198+ cli-wrappers = pkgs.stdenv.mkDerivation {
199+ name = "tinc-cli-wrappers";
200+ buildInputs = [ pkgs.makeWrapper ];
201+ buildCommand = ''
202+ mkdir -p $out/bin
203+ ${concatStringsSep "\n" (mapAttrsToList (network: data: ''
204+ makeWrapper ${data.package}/bin/tinc "$out/bin/tinc.${network}" --add-flags "--pidfile=/run/tinc.${network}.pid"
205+ '') cfg.networks)}
206+ '';
207+ };
208+ in [ cli-wrappers ];
209+
197210 users.extraUsers = flip mapAttrs' cfg.networks (network: _:
198211 nameValuePair ("tinc.${network}") ({
199212 description = "Tinc daemon user for ${network}";