about summary refs log tree commit diff
path: root/pkgs/applications/misc/kratos/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/misc/kratos/default.nix')
-rw-r--r--pkgs/applications/misc/kratos/default.nix36
1 files changed, 24 insertions, 12 deletions
diff --git a/pkgs/applications/misc/kratos/default.nix b/pkgs/applications/misc/kratos/default.nix
index d5d12eb44676d..5f38d116d82e0 100644
--- a/pkgs/applications/misc/kratos/default.nix
+++ b/pkgs/applications/misc/kratos/default.nix
@@ -1,22 +1,34 @@
-{ fetchFromGitHub, buildGoModule, lib, stdenv }:
-
-buildGoModule rec {
+{
+  fetchFromGitHub,
+  buildGoModule,
+  lib,
+  stdenv
+}:
+let
   pname = "kratos";
-  version = "1.1.0";
+  version = "1.2.0";
+in
+buildGoModule {
+  inherit pname version;
 
   src = fetchFromGitHub {
     owner = "ory";
     repo = "kratos";
     rev = "v${version}";
-    hash = "sha256-zrII2lpffZkwFauPAilh1QaqRKvpj1mlHZA7in1ljYg=";
+    hash = "sha256-KqF6DYrEsmPj2PtI2+5ztE0m9uBO1gpNlvdo+Aw6REA=";
   };
 
-  vendorHash = "sha256-TSB7jCPOVwub+ZQaaUSmsz/R4HAfmnWb0wTf2w4aeuk=";
+  vendorHash = "sha256-6gJf+8AKjV83MTF0rC8OxDwkwGx4CJg7SdfNgcja8QY=";
 
   subPackages = [ "." ];
 
   tags = [ "sqlite" ];
 
+  # Pass versioning information via ldflags
+  ldflags = [
+    "-X github.com/ory/kratos/driver/config.Version=${version}"
+  ];
+
   doCheck = false;
 
   preBuild = ''
@@ -30,14 +42,14 @@ buildGoModule rec {
     patchShebangs "''${files[@]}"
 
     # patchShebangs doesn't work for this Makefile, do it manually
-    substituteInPlace Makefile --replace '/bin/bash' '${stdenv.shell}'
+    substituteInPlace Makefile --replace-fail '/usr/bin/env bash' '${stdenv.shell}'
   '';
 
-  meta = with lib; {
-    maintainers = with maintainers; [ mrmebelman ];
-    homepage = "https://www.ory.sh/kratos/";
-    license = licenses.asl20;
-    description = "An API-first Identity and User Management system that is built according to cloud architecture best practices";
+  meta = {
     mainProgram = "kratos";
+    description = "API-first Identity and User Management system that is built according to cloud architecture best practices";
+    homepage = "https://www.ory.sh/kratos/";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ mrmebelman ];
   };
 }