-
-
Save Kiwi/ad860df1e68b6fb72195fd24bbf6ee66 to your computer and use it in GitHub Desktop.
nixos-rebuild --upgrade that updates all nix-channels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nixos-rebuild = [(lib.hiPrio (pkgs.writeShellScriptBin "nixos-rebuild" | |
'' | |
REAL_ARGS=() ; | |
while [[ $# -gt 0 ]] ; do | |
if [[ --upgrade = $1 ]] ; | |
then nix-channel --update ; shift ; | |
fi ; | |
REAL_ARGS+=("$1") ; | |
shift ; | |
done ; | |
exec ${config.system.build.nixos-rebuild}/bin/nixos-rebuild ''${REAL_ARGS[@]}'' | |
))]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment