Save commit in shell variable

This commit is contained in:
Rodrigo Arias 2024-09-18 15:12:14 +02:00
parent 11ed3dc731
commit 88a4e239a1

View File

@ -80,6 +80,7 @@
build = nixosconf.config.system.build; build = nixosconf.config.system.build;
in syspkgs.mkShell { in syspkgs.mkShell {
pname = "lagarto-hun-shell"; pname = "lagarto-hun-shell";
COMMIT = if self ? rev then self.rev else "dirty";
TOPLEVEL = build.toplevel; TOPLEVEL = build.toplevel;
OPENSBI = syspkgs.opensbi; OPENSBI = syspkgs.opensbi;
KERNEL = build.kernel; KERNEL = build.kernel;
@ -88,6 +89,7 @@
UBOOT_ENV = syspkgs.uboot-env; UBOOT_ENV = syspkgs.uboot-env;
shellHook = '' shellHook = ''
echo "Here are the current system pieces:" echo "Here are the current system pieces:"
echo " COMMIT = $COMMIT"
echo " TOPLEVEL = $TOPLEVEL" echo " TOPLEVEL = $TOPLEVEL"
echo " KERNEL = $KERNEL" echo " KERNEL = $KERNEL"
echo " OPENSBI = $OPENSBI" echo " OPENSBI = $OPENSBI"
@ -104,6 +106,7 @@
build = nixosconf.config.system.build; build = nixosconf.config.system.build;
in syspkgs.mkShell rec { in syspkgs.mkShell rec {
pname = "lagarto-ox-shell"; pname = "lagarto-ox-shell";
COMMIT = if self ? rev then self.rev else "dirty";
TOPLEVEL = build.toplevel; TOPLEVEL = build.toplevel;
OPENSBI = syspkgs.opensbi; OPENSBI = syspkgs.opensbi;
KERNEL = build.kernel; KERNEL = build.kernel;
@ -115,6 +118,7 @@
GCROOT = mkRoots syspkgs [ syspkgs.stdenv KERNEL OPENSBI ]; GCROOT = mkRoots syspkgs [ syspkgs.stdenv KERNEL OPENSBI ];
shellHook = '' shellHook = ''
echo "Here are the current system pieces:" echo "Here are the current system pieces:"
echo " COMMIT = $COMMIT"
echo " TOPLEVEL = $TOPLEVEL" echo " TOPLEVEL = $TOPLEVEL"
echo " KERNEL = $KERNEL" echo " KERNEL = $KERNEL"
echo " OPENSBI = $OPENSBI" echo " OPENSBI = $OPENSBI"