diff --git a/flake.nix b/flake.nix index 6c13f447..f26ec96e 100644 --- a/flake.nix +++ b/flake.nix @@ -52,7 +52,7 @@ versionInfo = { commitHash = if (self ? rev) then self.rev else self.dirtyRev; - commitDate = lib.readFile "${prev.runCommand "timestamp" { env.when = self.lastModified; } "echo -n `date -d @$when --iso-8601=s` > $out"}"; + commitDate = self.lastModified; }; }; }); @@ -85,7 +85,7 @@ inherit pkgs lib; versionInfo = { commitHash = if (self ? rev) then self.rev else self.dirtyRev; - commitDate = lib.readFile "${pkgs.runCommand "timestamp" { env.when = self.lastModified; } "echo -n `date -d @$when --iso-8601=s` > $out"}"; + commitDate = self.lastModified; }; }); }; diff --git a/nix/pkgs/frontend.nix b/nix/pkgs/frontend.nix index e90f2aec..3f4caa2b 100644 --- a/nix/pkgs/frontend.nix +++ b/nix/pkgs/frontend.nix @@ -41,10 +41,10 @@ pkgs.buildNpmPackage (lib.fix (self: { }; preBuild = let - versionExports = ([ ] ++ (lib.optional (versionInfo ? commitHash) - ''export COMMIT_HASH="${versionInfo.commitHash}"'') - ++ (lib.optional (versionInfo ? commitDate) - ''export COMMIT_DATE="${versionInfo.commitDate}"'')); + versionExports = ([ ] + ++ (lib.optional (versionInfo ? commitHash) ''export COMMIT_HASH="${versionInfo.commitHash}"'') + ++ (lib.optional (versionInfo ? commitDate) ''export COMMIT_DATE="$(date -d @${builtins.toString versionInfo.commitDate} --iso-8601=s)"'') + ); in '' ${lib.concatStringsSep "\n" versionExports} '';