Revert "nixpkgs: patching test"

This reverts commit 6204949bdcd106a328fa9fccd779aa99a4753713.
This commit is contained in:
Simon Gardling 2025-11-24 16:43:16 -05:00
parent 6204949bdc
commit 7532efdc28
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
2 changed files with 4 additions and 132 deletions

View File

@ -1,118 +0,0 @@
From 35d194ebf61d1fc29bc3759249dae5dd6096a5c0 Mon Sep 17 00:00:00 2001
From: Simon Gardling <titaniumtown@proton.me>
Date: Mon, 24 Nov 2025 15:06:26 -0500
Subject: [PATCH] feat: make boot messages configureable
---
nixos/modules/system/boot/stage-1-init.sh | 4 ++--
nixos/modules/system/boot/stage-1.nix | 21 ++++++++++++++++++++-
nixos/modules/system/boot/stage-2-init.sh | 2 +-
nixos/modules/system/boot/stage-2.nix | 11 ++++++++++-
4 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh
index b8dbfb70c0bb..09ef663dbb6f 100644
--- a/nixos/modules/system/boot/stage-1-init.sh
+++ b/nixos/modules/system/boot/stage-1-init.sh
@@ -73,7 +73,7 @@ trap 'fail' 0
# Print a greeting.
info
-info "<<< @distroName@ Stage 1 >>>"
+info "[1;32m@stage1Greeting@[0m"
info
# Make several required directories.
@@ -445,7 +445,7 @@ lustrateRoot () {
local root="$1"
echo
- echo -e "\e[1;33m<<< @distroName@ is now lustrating the root filesystem (cruft goes to /old-root) >>>\e[0m"
+ echo -e "\\e[1;33m@lustrateMessage@\\e[0m"
echo
mkdir -m 0755 -p "$root/old-root.tmp"
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix
index c87b3ecef4da..434e33ee8b70 100644
--- a/nixos/modules/system/boot/stage-1.nix
+++ b/nixos/modules/system/boot/stage-1.nix
@@ -309,7 +309,8 @@ let
inherit (config.boot) resumeDevice;
- inherit (config.system.nixos) distroName;
+ stage1Greeting = config.boot.initrd.stage1Greeting;
+ lustrateMessage = config.boot.initrd.lustrateMessage;
inherit (config.system.build) earlyMountScript;
@@ -686,6 +687,24 @@ in
'';
};
+ boot.initrd.stage1Greeting = mkOption {
+ type = types.str;
+ default = "<<< ${config.system.nixos.distroName} Stage 1 >>>";
+ defaultText = lib.literalExpression ''"<<< ''${config.system.nixos.distroName} Stage 1 >>>"'';
+ description = ''
+ The greeting message displayed during NixOS stage 1 boot.
+ '';
+ };
+
+ boot.initrd.lustrateMessage = mkOption {
+ type = types.str;
+ default = "<<< ${config.system.nixos.distroName} is now lustrating the root filesystem (cruft goes to /old-root) >>>";
+ defaultText = lib.literalExpression ''"<<< ''${config.system.nixos.distroName} is now lustrating the root filesystem (cruft goes to /old-root) >>>"'';
+ description = ''
+ The message displayed when lustrating the root filesystem.
+ '';
+ };
+
boot.loader.supportsInitrdSecrets = mkOption {
internal = true;
default = false;
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index e960f1bbcc39..c9884a719012 100755
--- a/nixos/modules/system/boot/stage-2-init.sh
+++ b/nixos/modules/system/boot/stage-2-init.sh
@@ -19,7 +19,7 @@ if [ "${IN_NIXOS_SYSTEMD_STAGE1:-}" != true ]; then
# Print a greeting.
echo
- echo -e "\e[1;32m<<< @distroName@ Stage 2 >>>\e[0m"
+ echo -e "\\e[1;32m@stage2Greeting@\\e[0m"
echo
diff --git a/nixos/modules/system/boot/stage-2.nix b/nixos/modules/system/boot/stage-2.nix
index 9565ac5e8ef1..993f4415cf24 100644
--- a/nixos/modules/system/boot/stage-2.nix
+++ b/nixos/modules/system/boot/stage-2.nix
@@ -19,7 +19,7 @@ let
systemConfig = null; # replaced in ../activation/top-level.nix
inherit (config.boot) systemdExecutable;
nixStoreMountOpts = lib.concatStringsSep " " (map lib.escapeShellArg config.boot.nixStoreMountOpts);
- inherit (config.system.nixos) distroName;
+ stage2Greeting = config.boot.stage2Greeting;
inherit useHostResolvConf;
inherit (config.system.build) earlyMountScript;
path = lib.makeBinPath (
@@ -87,6 +87,15 @@ in
'';
};
+ stage2Greeting = mkOption {
+ type = types.str;
+ default = "<<< ${config.system.nixos.distroName} Stage 2 >>>";
+ defaultText = lib.literalExpression ''"<<< ''${config.system.nixos.distroName} Stage 2 >>>"'';
+ description = ''
+ The greeting message displayed during NixOS stage 2 boot.
+ '';
+ };
+
extraSystemdUnitPaths = mkOption {
default = [ ];
type = types.listOf types.str;
--
2.51.2

View File

@ -70,6 +70,7 @@
outputs = outputs =
{ {
self, self,
nixpkgs,
lanzaboote, lanzaboote,
nixos-hardware, nixos-hardware,
home-manager, home-manager,
@ -85,26 +86,15 @@
"yarn" "yarn"
]; ];
niri-package = inputs.niri.packages.${system}.niri-unstable; niri-package = inputs.niri.packages.${system}.niri-unstable;
patchedNixpkgsSrc = (import inputs.nixpkgs { inherit system; }).applyPatches {
name = "nixpkgs-patched";
src = inputs.nixpkgs;
patches = [ ./0001-feat-make-boot-messages-configureable.patch ];
};
patchedNixpkgs = import patchedNixpkgsSrc { inherit system; };
in in
{ {
formatter.${system} = patchedNixpkgs.nixfmt-rfc-style; formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
nixosConfigurations = patchedNixpkgs.lib.foldl' ( nixosConfigurations = nixpkgs.lib.foldl' (
config: hostname: config: hostname:
config config
// { // {
"${hostname}" = import "${patchedNixpkgsSrc}/nixos/lib/eval-config.nix" { "${hostname}" = nixpkgs.lib.nixosSystem {
lib = patchedNixpkgs.lib;
baseModules = import "${patchedNixpkgsSrc}/nixos/modules/module-list.nix";
inherit system;
specialArgs = { specialArgs = {
inherit inherit
inputs inputs