Skip to content

Instantly share code, notes, and snippets.

@justinas
Created November 28, 2020 13:37
Show Gist options
  • Save justinas/9871cab3db0ff0ef5012912142ed4d81 to your computer and use it in GitHub Desktop.
Save justinas/9871cab3db0ff0ef5012912142ed4d81 to your computer and use it in GitHub Desktop.
See what packages would be rebuilt (updated) upon a nixos-rebuild (as a script and as a derivation)
{ pkgs ? import <nixpkgs> { } }:
pkgs.writeShellScriptBin "nixos-outdated" ''
nixos-rebuild dry-build 2>&1 \
| ${pkgs.gnugrep}/bin/grep /nix/store \
| ${pkgs.coreutils}/bin/cut -d '/' -f 4 \
| ${pkgs.coreutils}/bin/cut -d '-' -f 2- \
| ${pkgs.coreutils}/bin/sort
''
#!/usr/bin/env bash
nixos-rebuild dry-build 2>&1 \
| grep /nix/store \
| cut -d '/' -f 4 \
| cut -d '-' -f 2- \
| sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment