Skip to content

Commit 2942a8d

Browse files
committed
chore: print the last modified date of "flake.lock"
1 parent 7c30fc3 commit 2942a8d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

flake.nix

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,20 @@
2121
{ pkgs }:
2222
{
2323
default = pkgs.mkShell {
24-
# The Nix packages provided in the environment.
24+
# The Nix packages installed in the dev environment.
2525
packages = with pkgs; [
2626
opentofu # infrastructure as code
2727
sops # simple tool for managing secrets
2828
git-cliff # changelog generator
2929
trivy # scan security issues
3030
];
31+
# The shell script executed when the environment is activated.
32+
shellHook = ''
33+
# Print the last modified date of "flake.lock".
34+
stat flake.lock | grep "Modify" |
35+
awk '{printf "\"flake.lock\" last modified on: %s", $2}' &&
36+
echo " ($((($(date +%s) - $(stat -c %Y flake.lock)) / 86400)) days ago)"
37+
'';
3138
};
3239
}
3340
);

0 commit comments

Comments
 (0)