Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-xray-daemon-V3.0.0 | awx-xray-daemon: init at V3.0.0 #53565

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Expand Up @@ -473,6 +473,7 @@
./services/monitoring/vnstat.nix
./services/monitoring/zabbix-agent.nix
./services/monitoring/zabbix-server.nix
./services/monitoring/aws-xray-daemon.nix
./services/network-filesystems/beegfs.nix
./services/network-filesystems/cachefilesd.nix
./services/network-filesystems/davfs2.nix
Expand Down
41 changes: 41 additions & 0 deletions nixos/modules/services/monitoring/aws-xray-daemon.nix
@@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:

with lib;

let

cfg = config.services.aws-xray-daemon;

configFile = pkgs.writeText "xray.yaml" cfg.config;

in
{
options.services.aws-xray-daemon = {
enable = mkEnableOption "Whether to enable aws-xray-daemon service";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
enable = mkEnableOption "Whether to enable aws-xray-daemon service";
enable = mkEnableOption "the aws-xray-daemon service";

The "whether to enable" part gets added automatically.


package = mkOption {
description = "Which aws-xray-daemon package to use";
default = pkgs.aws-xray-daemon;
ryantm marked this conversation as resolved.
Show resolved Hide resolved
defaultText = "pkgs.aws-xray-daemon";
type = types.package;
};

config = mkOption {
description = "Aws xray configurations json or yaml formatted.";
default = "Version: 2";
type = types.str;
};
};

config = mkIf cfg.enable {
systemd.services.aws-xray-daemon = {
description = "aws xray daemon service";
wantedBy = [ "multi-user.target" ];
after = [ "networking.target" ];
serviceConfig = {
DynamicUser = true;
ExecStart = "${cfg.package.bin}/bin/daemon --config ${configFile}";
};
};
};
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing final newline

24 changes: 24 additions & 0 deletions pkgs/tools/networking/aws-xray-daemon/default.nix
@@ -0,0 +1,24 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:

buildGoPackage rec {
name = "aws-xray-daemon-${version}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name = "aws-xray-daemon-${version}";
pname = "aws-xray-daemon";

name becomes ${pname}-${version} automatically.

version = "V3.0.0";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not typical to have the prefix of V in the version, even if it is in the tag or release name.

Suggested change
version = "V3.0.0";
version = "3.0.0";


goPackagePath = "github.com/aws/aws-xray-daemon";
subPackages = [ "daemon" ];

src = fetchFromGitHub {
owner = "aws";
repo = "aws-xray-daemon";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
repo = "aws-xray-daemon";
repo = pname;

rev = "${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rev = "${version}";
rev = "V${version}";

sha256 = "090z5q7iw6y9c0d70z29mxqw55yxxh9d8bnl6lxda72rhmdnvfcq";
};

goDeps = ./deps.nix;

meta = {
homepage = "https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html";
description = "aws X-RAY daemon.";
license = stdenv.lib.licenses.asl20;
};
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing final newline

146 changes: 146 additions & 0 deletions pkgs/tools/networking/aws-xray-daemon/deps.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -634,6 +634,8 @@ in

aws-vault = callPackage ../tools/admin/aws-vault { };

aws-xray-daemon = callPackage ../tools/networking/aws-xray-daemon { };

iamy = callPackage ../tools/admin/iamy { };

azure-cli = nodePackages_8_x.azure-cli;
Expand Down