Merge pull request #104785 from Xe/patch-3

nixos/modules/tailscale: add package as an option
This commit is contained in:
Andreas Rammhold 2020-12-01 12:52:41 +01:00 committed by GitHub
commit 96663ea477
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,11 +14,18 @@ in {
default = 41641;
description = "The port to listen on for tunnel traffic (0=autoselect).";
};
package = mkOption {
type = types.package;
default = pkgs.tailscale;
defaultText = "pkgs.tailscale";
description = "The package to use for tailscale";
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.tailscale ]; # for the CLI
systemd.packages = [ pkgs.tailscale ];
environment.systemPackages = [ cfg.package ]; # for the CLI
systemd.packages = [ cfg.package ];
systemd.services.tailscaled = {
wantedBy = [ "multi-user.target" ];
serviceConfig.Environment = "PORT=${toString cfg.port}";