mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-10 16:45:51 +03:00
nixos/systemd-stage-1: Append (Initrd) to /etc/initrd-release
This is more in line with what dracut does (it appends "Initramfs") and makes it clear where the boot is currently at when it hangs.
This commit is contained in:
parent
5653209ed9
commit
7ebb4ebe40
@ -11,6 +11,26 @@ let
|
||||
attrsToText = attrs:
|
||||
concatStringsSep "\n" (mapAttrsToList (n: v: ''${n}="${toString v}"'') attrs);
|
||||
|
||||
osReleaseContents = {
|
||||
NAME = "NixOS";
|
||||
ID = "nixos";
|
||||
VERSION = "${cfg.release} (${cfg.codeName})";
|
||||
VERSION_CODENAME = toLower cfg.codeName;
|
||||
VERSION_ID = cfg.release;
|
||||
BUILD_ID = cfg.version;
|
||||
PRETTY_NAME = "NixOS ${cfg.release} (${cfg.codeName})";
|
||||
LOGO = "nix-snowflake";
|
||||
HOME_URL = "https://nixos.org/";
|
||||
DOCUMENTATION_URL = "https://nixos.org/learn.html";
|
||||
SUPPORT_URL = "https://nixos.org/community.html";
|
||||
BUG_REPORT_URL = "https://github.com/NixOS/nixpkgs/issues";
|
||||
};
|
||||
|
||||
initrdReleaseContents = osReleaseContents // {
|
||||
PRETTY_NAME = "${osReleaseContents.PRETTY_NAME} (Initrd)";
|
||||
};
|
||||
initrdRelease = pkgs.writeText "initrd-release" (attrsToText initrdReleaseContents);
|
||||
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
@ -115,20 +135,12 @@ in
|
||||
DISTRIB_DESCRIPTION = "NixOS ${cfg.release} (${cfg.codeName})";
|
||||
};
|
||||
|
||||
"os-release".text = attrsToText {
|
||||
NAME = "NixOS";
|
||||
ID = "nixos";
|
||||
VERSION = "${cfg.release} (${cfg.codeName})";
|
||||
VERSION_CODENAME = toLower cfg.codeName;
|
||||
VERSION_ID = cfg.release;
|
||||
BUILD_ID = cfg.version;
|
||||
PRETTY_NAME = "NixOS ${cfg.release} (${cfg.codeName})";
|
||||
LOGO = "nix-snowflake";
|
||||
HOME_URL = "https://nixos.org/";
|
||||
DOCUMENTATION_URL = "https://nixos.org/learn.html";
|
||||
SUPPORT_URL = "https://nixos.org/community.html";
|
||||
BUG_REPORT_URL = "https://github.com/NixOS/nixpkgs/issues";
|
||||
};
|
||||
"os-release".text = attrsToText osReleaseContents;
|
||||
};
|
||||
|
||||
boot.initrd.systemd.contents = {
|
||||
"/etc/os-release".source = initrdRelease;
|
||||
"/etc/initrd-release".source = initrdRelease;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -353,8 +353,6 @@ in {
|
||||
DefaultEnvironment=PATH=/bin:/sbin
|
||||
'';
|
||||
|
||||
"/etc/initrd-release".source = config.environment.etc.os-release.source;
|
||||
"/etc/os-release".source = config.environment.etc.os-release.source;
|
||||
"/etc/fstab".source = fstab;
|
||||
|
||||
"/lib/modules".source = "${modulesClosure}/lib/modules";
|
||||
|
Loading…
Reference in New Issue
Block a user