Browse Source

feat: add commit timestamp to oci-image

merge-requests/181/merge
Samuel Meenzen 2 months ago committed by Matthias Ahouansou
parent
commit
945934ac41
  1. 7
      flake.nix
  2. 2
      nix/pkgs/oci-image/default.nix

7
flake.nix

@ -61,6 +61,13 @@
# See also `rust-toolchain.toml`
sha256 = "sha256-AJ6LX/Q/Er9kS15bn9iflkUwcgYqRQxiOIL2ToVAXaU=";
};
# The timestamp of the last commit in ISO 8601 format
timestamp = pkgs.lib.strings.trim (builtins.readFile (
pkgs.runCommand "iso-timestamp" {} ''
date -u -d "@${toString inputs.self.lastModified}" +%Y-%m-%dT%H:%M:%SZ > $out
''
));
});
in
inputs.flake-utils.lib.eachDefaultSystem (system:

2
nix/pkgs/oci-image/default.nix

@ -3,6 +3,7 @@
, dockerTools
, lib
, pkgs
, timestamp
}:
let
# See https://github.com/krallin/tini/pull/223
@ -17,6 +18,7 @@ in
dockerTools.buildImage {
name = default.pname;
tag = "next";
created = timestamp;
copyToRoot = [
dockerTools.caCertificates
];

Loading…
Cancel
Save