Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.22 KB

README.md

File metadata and controls

44 lines (33 loc) · 1.22 KB

nixos-needsreboot

FlakeHub

Checks if you should reboot your NixOS ️❄️ machine in case an upgrade delivered new toys 🎁

This project is forked from https://codeberg.org/Mynacol/nixos-needsreboot, which was forked from https://github.com/thefossguy/nixos-needsreboot. My version only makes aesthetic changes to the output ✨ to suit my taste.

Usage as a flake

Add nixos-needsreboot to your flake.nix:

{
  inputs.nixos-needsreboot.url = "https://flakehub.com/f/wimpysworld/nixos-needsreboot/*.tar.gz";

  outputs = { self, nixos-needsreboot }: {
    # Use in your outputs
  };
}

Usage

Check if the currently active system needs a reboot

nixos-needsreboot

Check a different system if it would require a reboot

nixos-needsreboot [/path/to/different-system]

Test during NixOS system activation

  system.activationScripts = {
    nixos-needsreboot = {
      supportsDryActivation = true;
      text = "${lib.getExe nixos-needsreboot.packages.${pkgs.system}.default} \"$systemConfig\" || true";
    };
  };