0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

Merge pull request #10996 from oxij/nixos-label

nixos: introduce system.nixosLabel support
This commit is contained in:
Arseniy Seroka 2016-01-09 20:52:08 +03:00
commit c03fe79265
10 changed files with 77 additions and 39 deletions

View file

@ -67,7 +67,7 @@ let
echo -n "$configurationName" > $out/configuration-name
echo -n "systemd ${toString config.systemd.package.interfaceVersion}" > $out/init-interface-version
echo -n "$nixosVersion" > $out/nixos-version
echo -n "$nixosLabel" > $out/nixos-version
echo -n "$system" > $out/system
mkdir $out/fine-tune
@ -101,7 +101,7 @@ let
if [] == failed then pkgs.stdenv.mkDerivation {
name = let hn = config.networking.hostName;
nn = if (hn != "") then hn else "unnamed";
in "nixos-system-${nn}-${config.system.nixosVersion}";
in "nixos-system-${nn}-${config.system.nixosLabel}";
preferLocalBuild = true;
allowSubstitutes = false;
buildCommand = systemBuilder;
@ -115,7 +115,7 @@ let
config.system.build.installBootLoader
or "echo 'Warning: do not know how to make this configuration bootable; please enable a boot loader.' 1>&2; true";
activationScript = config.system.activationScripts.script;
nixosVersion = config.system.nixosVersion;
nixosLabel = config.system.nixosLabel;
configurationName = config.boot.loader.grub.configurationName;

View file

@ -83,7 +83,7 @@ addEntry() {
timestampEpoch=$(stat -L -c '%Z' $path)
timestamp=$(date "+%Y-%m-%d %H:%M" -d @$timestampEpoch)
nixosVersion="$(cat $path/nixos-version)"
nixosLabel="$(cat $path/nixos-version)"
extraParams="$(cat $path/kernel-params)"
echo
@ -91,7 +91,7 @@ addEntry() {
if [ "$tag" = "default" ]; then
echo " MENU LABEL NixOS - Default"
else
echo " MENU LABEL NixOS - Configuration $tag ($timestamp - $nixosVersion)"
echo " MENU LABEL NixOS - Configuration $tag ($timestamp - $nixosLabel)"
fi
echo " LINUX ../nixos/$(basename $kernel)"
echo " INITRD ../nixos/$(basename $initrd)"