Revert "modules/nixos/common/update: use grub.extraInstallCommands for boot diff"
This reverts commit 01137d599d
.
This commit is contained in:
parent
3026577760
commit
0dd66b1088
2 changed files with 6 additions and 10 deletions
modules/nixos/common
|
@ -12,6 +12,11 @@ nix-env --profile /nix/var/nix/profiles/system --set "$p"
|
||||||
booted="$(readlink /run/booted-system/{initrd,kernel,kernel-modules} && cat /run/booted-system/kernel-params)"
|
booted="$(readlink /run/booted-system/{initrd,kernel,kernel-modules} && cat /run/booted-system/kernel-params)"
|
||||||
built="$(readlink "$p"/{initrd,kernel,kernel-modules} && cat "$p"/kernel-params)"
|
built="$(readlink "$p"/{initrd,kernel,kernel-modules} && cat "$p"/kernel-params)"
|
||||||
if [[ $booted != "$built" ]]; then
|
if [[ $booted != "$built" ]]; then
|
||||||
|
if [[ -e /run/current-system ]]; then
|
||||||
|
echo "--- diff to current-system"
|
||||||
|
nvd diff /run/current-system "$p"
|
||||||
|
echo "---"
|
||||||
|
fi
|
||||||
/nix/var/nix/profiles/system/bin/switch-to-configuration boot
|
/nix/var/nix/profiles/system/bin/switch-to-configuration boot
|
||||||
# don't use kexec if system is virtualized, reboots are fast enough
|
# don't use kexec if system is virtualized, reboots are fast enough
|
||||||
if ! systemd-detect-virt -q; then
|
if ! systemd-detect-virt -q; then
|
||||||
|
|
|
@ -16,20 +16,11 @@
|
||||||
pkgs.coreutils
|
pkgs.coreutils
|
||||||
pkgs.curl
|
pkgs.curl
|
||||||
pkgs.kexec-tools
|
pkgs.kexec-tools
|
||||||
|
pkgs.nvd
|
||||||
];
|
];
|
||||||
script = builtins.readFile ./update.bash;
|
script = builtins.readFile ./update.bash;
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://gist.github.com/Ma27/6650d10f772511931647d3189b3eb1d7
|
|
||||||
# https://github.com/NuschtOS/nixos-modules/blob/39d26dddae2f117d7f9c33dd1efc866ff684ff94/modules/nix.nix
|
|
||||||
boot.loader.grub.extraInstallCommands = ''
|
|
||||||
if [[ "''${NIXOS_ACTION-}" == boot && -e /run/current-system && -e "''${1-}" ]]; then
|
|
||||||
echo "--- diff to current-system"
|
|
||||||
${pkgs.nvd}/bin/nvd --nix-bin-dir=${config.nix.package}/bin diff /run/current-system "''${1-}"
|
|
||||||
echo "---"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
systemd.timers.update-host = {
|
systemd.timers.update-host = {
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig.OnBootSec = "5m";
|
timerConfig.OnBootSec = "5m";
|
||||||
|
|
Loading…
Add table
Reference in a new issue