From 90566cc493ce4613147c5bb1d169f961ffde4ab8 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Sat, 5 Aug 2023 23:02:04 +0200
Subject: [PATCH] build: Refactor build process to include version and build
 information

- Updated build process to include version and build information using `versionTool`
- Improved security by updating `vendorSha256` with a new value
- Added code to build `versionTool` for the current system
- Enhanced functionality by fetching the version and build information using `versionTool`
---
 flake.nix | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/flake.nix b/flake.nix
index b7ba657..680c90e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -32,12 +32,6 @@
 #        # You'll need to provide the correct hash here.
 #        sha256 = "sha256-jzixQKFFW4oxO0S4GYqbkFCXzhBd6com6Z9+MtVKakU=";
 #      };   
-     versionToolPackage = versionTool.defaultPackage.${system};
-
-     versionAndBuild = pkgs.runCommand "get-version-and-build" {} ''
-        ${versionToolPackage}/bin/version print --git > $out.version
-        ${versionToolPackage}/bin/version build > $out.build
-      '';
    
 
     in
@@ -47,8 +41,20 @@
       packages = forAllSystems (system:
         let
           pkgs = nixpkgsFor.${system};
+          
+          # Build the versionTool for the current system.
+          versionToolPackage = versionTool.defaultPackage.${system};
+
+          versionAndBuild = pkgs.runCommand "get-version-and-build" {} ''
+            ${versionToolPackage}/bin/version print --git > $out.version
+            ${versionToolPackage}/bin/version build > $out.build
+          '';
+
           version = builtins.readFile "${versionAndBuild}.version";
           build = builtins.readFile "${versionAndBuild}.build";
+           
+          
+          
         in
         {
           docman = pkgs.buildGoModule {
-- 
GitLab