-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to Pin Version of Package #346
Comments
Hi @bdkiran 👋, Nix works a little differently than what you're used to with version pinning: You'll want to
For finding the version you want, I recommend searching at either https://lazamar.co.uk/nix-versions or https://www.nixhub.io/ as a starting point, and if that doesn't cut it you can always explore the Source Repo of Nix directly to find the precise commit that has the version you need. Once you have that, you can pass that to Example for Morph 1.7.0Let's say you want to pin to Morph https://www.nixhub.io/ lists Now we need to Pin Nixpkgs to that commit: name: infra-deployment
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Nix On Runner
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/d4f247e89f6e10120f911e2e2d2254a050d0f732.tar.gz
- name: Deploy to Production
uses: workflow/nix-shell-action@v3
with:
packages: morph # This will now use the exact morph version from the nixpkgs commit pinned above
script: |
morph deploy network.nix switch ... and you'll have Morph 1.7.0, pinned at that exact version, with all its build dependencies locked as well. |
Thanks for getting back to me on this. I appreciate you taking the time to explain some of the concepts of |
I have a pipeline that was running until a package that I use was updated and broke the package. In order to fix it short term, was hoping I could pin the version of the package in the nix shell action.
Error Log from Github Actions when run like above:
I have not seen any documentation of how to do this. Am I doing this correctly or is there a better way to do this?
The text was updated successfully, but these errors were encountered: