Commit fd1f078f authored by Michael Lohmann's avatar Michael Lohmann
Browse files

nixos-rebuild: remove list-generations piping into $PAGER

In https://github.com/NixOS/nixpkgs/issues/333734 it was noticed that
executing the list-generations with sudo would fail. The reason was,
that the variable $PAGER was set, but empty.

${PAGER:cat} only has the default of cat if PAGER is unset, but it will
not default to cat if the variable is empty instead.

One way of fixing this would have been to change it to ${PAGER:-cat},
but since a pager requires pressing an additional key to exit, it is a
bit annoying in the first place, so it was removed instead.
parent e1d92cda
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -729,8 +729,7 @@ EOF
                    .nixosVersion, .kernelVersion, .configurationRevision,
                    (.specialisations | join(" "))
                ] | @tsv' |
                column --separator $'\t' --table --table-columns "Generation,Build-date,NixOS version,Kernel,Configuration Revision,Specialisation" |
                ${PAGER:cat}
                column --separator $'\t' --table --table-columns "Generation,Build-date,NixOS version,Kernel,Configuration Revision,Specialisation"
        else
            jq --slurp .
        fi