all repos — searchix @ 7a87231d54558afa4679f8fdd6fd413123cf5b58

Search engine for NixOS, nix-darwin, home-manager and NUR users

build: enable versioning of package
Alan Pearce alan@alanpearce.eu
Fri, 17 May 2024 20:12:02 +0200
commit

7a87231d54558afa4679f8fdd6fd413123cf5b58

parent

76055d21b6248d0cb9cc9635d480027b46b6d304

2 files changed, 6 insertions(+), 6 deletions(-)

jump to
M nix/package.nixnix/package.nix
@@ -17,14 +17,10 @@ }: let
   inherit (builtins) concatStringsSep match;
 
-  version = "0-unstable-" + concatStringsSep "-" (match
-    "([[:digit:]]{4})([[:digit:]]{2})([[:digit:]]{2}).*"
-    self.lastModifiedDate
-  );
 in
 buildGoApplication {
   pname = "searchix";
-  inherit version;
+  version = "0.1.0";
   src = with pkgs.lib.fileset; toSource {
     root = ../.;
     fileset = difference
M searchix.gosearchix.go
@@ -52,7 +52,11 @@ func main() {
 	flag.Parse()
 	if *version {
-		fmt.Fprintln(os.Stderr, "searchix", buildVersion, config.CommitSHA)
+		fmt.Fprintf(os.Stderr, "searchix %s", buildVersion)
+		if buildVersion != config.CommitSHA && buildVersion != config.ShortSHA {
+			fmt.Fprintf(os.Stderr, " %s", config.CommitSHA)
+		}
+		fmt.Fprint(os.Stderr, "\n")
 		os.Exit(0)
 	}