nix-installer-action icon indicating copy to clipboard operation
nix-installer-action copied to clipboard

Consider logging installed version of Nix

Open marienz opened this issue 1 year ago • 1 comments

nix-installer-action downloads an unversioned nix-installer (#84), which installs (I think, as of https://github.com/DeterminateSystems/nix-installer/pull/897) an embedded version of Nix.

I can't work out from the Github Action (pretty or raw) logs which version of either of these components the action installed. It seems to be grabbing https://install.determinate.systems/nix-installer/stable/x86_64-linux from a cache instead of downloading it, I don't see a version number in the filename invoked, and neither nix-installer nor nix seem to log their version by default. Raw logs in case I missed something: logs.txt

This adds some annoyance to troubleshooting failing CI, both because the version may change underneath me and because I need to know the Nix version to reproduce elsewhere.

I can add an action that logs some info about Nix, but I think it would be convenient if nix-installer-action provided this information by default. I'm more interested in the version of Nix than the version of the installer.

This isn't the same as #84: I don't necessarily want to pin the version of Nix (or nix-installer), but I do want to know which version any given build ended up using.

marienz avatar May 26 '24 11:05 marienz

I came up with this as a workaround:

  • pinning the installer version (I know, not what you asked, you want it logged)
  • printing out the Nix version
      - uses: DeterminateSystems/nix-installer-action@v16
        with:
          source-url: https://github.com/DeterminateSystems/nix-installer/releases/download/v0.30.0/nix-installer-${{ matrix.platform.nix-installer.platform }}
      - name: Print Nix version
        run: |
          nix --version

Even though I'm using flakes down the road, I also wish the installer would also log any other state it captured that may matter when debugging, like which channels (if any) have been set up, or anything remotely like nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'.

lloeki avatar Nov 27 '24 08:11 lloeki