Open Shou opened 8 years ago
I have just realized that this is still the case in NixOS 17.09.
AFAIU, configurationName
is referenced in nixos/modules/system/activation/top-level.nix
only. The script that generates the grub menu entries is nixos/modules/system/boot/loader/grub/install-grub.pl
where "NixOS - Default"
is hardcoded.
I am not sure about the current use of configurationName
, but it seems that the following change in the Perl script may work (disclaimer: I'm not familiar with Perl)
my $configurationName = get("configurationName") or "NixOS - Default";
# and then
addEntry($configurationName, $defaultConfig);
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
This still does not work. In my Grub boot menu the entries are still named "NixOS - Default" and so on instead of "Kirbix - Default".
This is my boot loader config:
{ config, pkgs, ... }:
{
# [...] #
boot.loader = {
timeout = 1;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
grub = {
enable = true;
version = 2;
device = "nodev";
efiSupport = true;
efiInstallAsRemovable = false;
memtest86.enable = true;
backgroundColor = "#000000";
splashImage = ./res/nixos-boot-background-scaled.png;
configurationName = "Kirbix";
# Get gfxmodes from the grub cli with `videoinfo`
gfxmodeEfi = "1280x1024";
enableCryptodisk = true;
extraInitrd = /boot/initrd.keys.gz;
};
};
# [...] #
}
I marked this as stale due to inactivity. → More info
Still not solved :smiling_face_with_tear:
Still not solved :\
bumping, b/c i would find this handy
I work around this with the following snippet, edit according to your needs
system.activationScripts.update-grub-menu = {
text = ''
echo "Updating GRUB menu entry name..."
GRUB_CFG="/boot/grub/grub.cfg"
BACKUP_GRUB_CFG="/boot/grub/grub.cfg.bak"
SEARCH_STR="\"NixOS"
REPLACE_STR="\"<whatever text you want>"
if [ -f "$GRUB_CFG" ]; then
cp "$GRUB_CFG" "$BACKUP_GRUB_CFG"
${pkgs.gnused}/bin/sed -i "s/$SEARCH_STR/$REPLACE_STR/g" "$GRUB_CFG"
else
echo "Error: GRUB configuration file not found."
fi
'';
};
Perhaps relevant: https://github.com/NixOS/nixpkgs/pull/3796 (bd811d32b4b194b9e551a66069641a76bd8eab58), and its revert 4061c18c9878ca4b97a0e97debd5c533fc1422ff,
Issue description
Setting
boot.loader.grub.configurationName
in/etc/nixos/configuration.nix
to anything still generates an entry namedNixOS - Default
in GRUB.Technical details
16.09pre82105.7465bcd (Flounder)
nix-env (Nix) 1.11.2
"16.09pre82105.7465bcd"