Rebase to flake parts #4

This commit is contained in:
2026-05-01 17:25:23 -03:00
parent 2c576715de
commit 064ba9655a
11 changed files with 2019 additions and 0 deletions
@@ -0,0 +1,16 @@
{ pkgs, ... }: {
# Keep Raspberry Pi kernel cmdline in sync with current system profile.
system.activationScripts.updateRpiCmdline.text = ''
export PATH="${pkgs.gnused}/bin:''${PATH}"
for cmdline in /boot/firmware/nixos/*/cmdline.txt; do
[ -e "$cmdline" ] || continue
current_init="$(readlink -f /nix/var/nix/profiles/system)/init"
if grep -q 'init=/nix/store/' "$cmdline"; then
sed -i "s#init=/nix/store/[^ ]*/init#init=$current_init#" "$cmdline"
fi
if ! grep -q 'root=' "$cmdline"; then
sed -i 's/ init=/ root=PARTUUID=4d44c78a-ee3c-4e3e-9eee-0f2eb10347b6 rootfstype=ext4 init=/' "$cmdline"
fi
done
'';
}