Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Kiwi

Kiwi/default.nix Secret

Created October 23, 2019 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kiwi/ad860df1e68b6fb72195fd24bbf6ee66 to your computer and use it in GitHub Desktop.
Save Kiwi/ad860df1e68b6fb72195fd24bbf6ee66 to your computer and use it in GitHub Desktop.
nixos-rebuild --upgrade that updates all nix-channels
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