From 88a4e239a144f715fcd1da660b0c622ce0f7c5ce Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 18 Sep 2024 15:12:14 +0200 Subject: [PATCH] Save commit in shell variable --- flake.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flake.nix b/flake.nix index 9e50405..3219d44 100644 --- a/flake.nix +++ b/flake.nix @@ -80,6 +80,7 @@ build = nixosconf.config.system.build; in syspkgs.mkShell { pname = "lagarto-hun-shell"; + COMMIT = if self ? rev then self.rev else "dirty"; TOPLEVEL = build.toplevel; OPENSBI = syspkgs.opensbi; KERNEL = build.kernel; @@ -88,6 +89,7 @@ UBOOT_ENV = syspkgs.uboot-env; shellHook = '' echo "Here are the current system pieces:" + echo " COMMIT = $COMMIT" echo " TOPLEVEL = $TOPLEVEL" echo " KERNEL = $KERNEL" echo " OPENSBI = $OPENSBI" @@ -104,6 +106,7 @@ build = nixosconf.config.system.build; in syspkgs.mkShell rec { pname = "lagarto-ox-shell"; + COMMIT = if self ? rev then self.rev else "dirty"; TOPLEVEL = build.toplevel; OPENSBI = syspkgs.opensbi; KERNEL = build.kernel; @@ -115,6 +118,7 @@ GCROOT = mkRoots syspkgs [ syspkgs.stdenv KERNEL OPENSBI ]; shellHook = '' echo "Here are the current system pieces:" + echo " COMMIT = $COMMIT" echo " TOPLEVEL = $TOPLEVEL" echo " KERNEL = $KERNEL" echo " OPENSBI = $OPENSBI"