Author: eelco
Date: Sat Apr 14 17:09:59 2012
New Revision: 33785
URL: https://nixos.org/websvn/nix/?rev=33785&sc=1
Log:
* Store the NixOS version in the top-level derivation.
* Change the name of the top-level derivation from "system" to
"nixos-<version>".
* Show the NixOS version in the GRUB boot menu instead of the kernel
version.
Modified:
nixos/trunk/modules/installer/grub/grub-menu-builder.sh
nixos/trunk/modules/system/activation/top-level.nix
Modified: nixos/trunk/modules/installer/grub/grub-menu-builder.sh
==============================================================================
--- nixos/trunk/modules/installer/grub/grub-menu-builder.sh Sat Apr 14
14:19:13 2012 (r33784)
+++ nixos/trunk/modules/installer/grub/grub-menu-builder.sh Sat Apr 14
17:09:59 2012 (r33785)
@@ -274,9 +274,10 @@
| sed 's/system-\([0-9]\+\)-link/\1/' \
| sort -n -r); do
link=/nix/var/nix/profiles/system-$generation-link
- date=$(stat --printf="%y\n" $link | sed 's/\..*//')
+ date=$(stat --printf="%y\n" $link | sed 's/\..*//' | sed 's/ .*//')
kernelVersion=$(cd $(dirname $(readlink -f $link/kernel))/lib/modules &&
echo *)
- addEntry "NixOS - Configuration $generation ($date - $kernelVersion)"
$link "$generation ($date)"
+ nixosVersion=$(if [ -e $link/nixos-version ]; then cat
$link/nixos-version; fi)
+ addEntry "NixOS - Configuration $generation ($date -
${nixosVersion:-$kernelVersion})" $link "$generation ($date)"
done
Modified: nixos/trunk/modules/system/activation/top-level.nix
==============================================================================
--- nixos/trunk/modules/system/activation/top-level.nix Sat Apr 14 14:19:13
2012 (r33784)
+++ nixos/trunk/modules/system/activation/top-level.nix Sat Apr 14 17:09:59
2012 (r33785)
@@ -120,9 +120,10 @@
ln -s ${config.system.build.upstart} $out/upstart
ln -s ${config.hardware.firmware} $out/firmware
- echo "$kernelParams" > $out/kernel-params
- echo "$configurationName" > $out/configuration-name
- echo "${toString config.system.build.upstart.interfaceVersion}" >
$out/upstart-interface-version
+ echo -n "$kernelParams" > $out/kernel-params
+ echo -n "$configurationName" > $out/configuration-name
+ echo -n "${toString config.system.build.upstart.interfaceVersion}" >
$out/upstart-interface-version
+ echo -n "$nixosVersion" > $out/nixos-version
mkdir $out/fine-tune
childCount=0
@@ -145,7 +146,7 @@
# script `switch-to-configuration' that activates the configuration
# and makes it bootable.
system = pkgs.stdenv.mkDerivation {
- name = "system";
+ name = "nixos-${config.system.nixosVersion}";
buildCommand = systemBuilder;
inherit children;
kernelParams =
@@ -153,6 +154,7 @@
menuBuilder = config.system.build.menuBuilder;
initScriptBuilder = config.system.build.initScriptBuilder;
activationScript = config.system.activationScripts.script;
+ nixosVersion = config.system.nixosVersion;
jobs = map (j: j.name) (attrValues config.jobs);
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits