From 8786fdec30a030bb76f1c259917a3e670a404a61 Mon Sep 17 00:00:00 2001 From: Vladyslav Burzakovskyy Date: Wed, 8 May 2024 18:37:42 +0200 Subject: [PATCH] kratos: git rid of 'with' and 'rec' where possible, fix Makefile shell path patching, move commit hash to variables --- pkgs/applications/misc/kratos/default.nix | 26 ++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/misc/kratos/default.nix b/pkgs/applications/misc/kratos/default.nix index 68437cbb2746..6bf06be9be7e 100644 --- a/pkgs/applications/misc/kratos/default.nix +++ b/pkgs/applications/misc/kratos/default.nix @@ -1,8 +1,15 @@ -{ fetchFromGitHub, buildGoModule, lib, stdenv }: - -buildGoModule rec { +{ + fetchFromGitHub, + buildGoModule, + lib, + stdenv +}: +let pname = "kratos"; version = "1.1.0"; +in +buildGoModule { + inherit pname version; src = fetchFromGitHub { owner = "ory"; @@ -20,7 +27,6 @@ buildGoModule rec { # Pass versioning information via ldflags ldflags = [ "-X github.com/ory/kratos/driver/config.Version=${version}" - "-X github.com/ory/kratos/driver/config.Commit=f47675b82012e0ff74b05b9b7e713b3aa2fdda54" ]; doCheck = false; @@ -36,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 = "An 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 ]; }; }