about summary refs log tree commit diff
path: root/pkgs/tools/system/nsc/default.nix
diff options
context:
space:
mode:
authorConnor Brewster <cbrewster@hey.com>2023-02-19 15:45:31 -0600
committerConnor Brewster <cbrewster@hey.com>2023-02-20 20:50:54 -0600
commitd897ab40f2280be2f625780909110f6ec8b238c1 (patch)
tree68c36cc195ebe863d61eb8b92378d2cf5fd70fb3 /pkgs/tools/system/nsc/default.nix
parent4624ec9f3e4280d2e052cfbbe2e18fb681424414 (diff)
downloadnixlib-d897ab40f2280be2f625780909110f6ec8b238c1.tar
nixlib-d897ab40f2280be2f625780909110f6ec8b238c1.tar.gz
nixlib-d897ab40f2280be2f625780909110f6ec8b238c1.tar.bz2
nixlib-d897ab40f2280be2f625780909110f6ec8b238c1.tar.lz
nixlib-d897ab40f2280be2f625780909110f6ec8b238c1.tar.xz
nixlib-d897ab40f2280be2f625780909110f6ec8b238c1.tar.zst
nixlib-d897ab40f2280be2f625780909110f6ec8b238c1.zip
nsc: init at 2.7.6
Diffstat (limited to 'pkgs/tools/system/nsc/default.nix')
-rw-r--r--pkgs/tools/system/nsc/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/tools/system/nsc/default.nix b/pkgs/tools/system/nsc/default.nix
new file mode 100644
index 000000000000..69f16d65c576
--- /dev/null
+++ b/pkgs/tools/system/nsc/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, stdenv
+, buildGoModule
+, fetchFromGitHub
+}:
+
+buildGoModule rec {
+  pname = "nsc";
+  version = "2.7.6";
+
+  src = fetchFromGitHub {
+    owner = "nats-io";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-aieUCQ5JVJQs4RoTGaXwfTv3xC1ozSsQyfCLsD245go=";
+  };
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X main.version=v${version}"
+    "-X main.builtBy=nixpkgs"
+  ];
+
+  vendorHash = "sha256-gDwppx0ORG+pXzTdGtUVbiFyTD/P7avt+/V89Gl0QYY=";
+
+  preCheck = ''
+    # Tests attempt to write to the home directory.
+    export HOME=$(mktemp -d)
+  '';
+
+  meta = {
+    description = "A tool for creating NATS account and user access configurations";
+    homepage = "https://github.com/nats-io/nsc";
+    license = with lib.licenses; [ asl20 ];
+    maintainers = with lib.maintainers; [ cbrewster ];
+    mainProgram = "nsc";
+    broken = stdenv.isDarwin;
+  };
+}