Skip to content
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

Include instructions for installing with home manager #117

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

zimeg
Copy link
Contributor

@zimeg zimeg commented Jan 27, 2024

Summary

This PR adds a section to the installation instructions for installing the current version of wd with home manager. Tested this with my own setup and it seems to be working well!

Notes

The rev and sha256 fields are tied to a specific release tag and might need updating with new releases. Or it could just be reference for the format. Using the latest tag with an incorrect hash will error with the correct hash displayed, so it's not too bad to figure out the new hash.

But a more formal approach might use `nix-prefetch` to find the actual hash for the version.
$ nix-prefetch-git https://github.com/mfaerevaag/wd v0.5.2
...
{
  "url": "https://github.com/mfaerevaag/wd",
  "rev": "a3ee1ec68ef172d7f8e8f48266ea680c801217b9",
  "date": "2022-10-06T18:18:47+01:00",
  "path": "/nix/store/hjda1gwzxiz3i1axcnwwj71swkvj9kfw-wd",
  "sha256": "063nl0x6y75bsnalppyy69y121fsnv8nfykb8bdl4dd13am7a8p3",
  "hash": "sha256-4yJ1qhqhNULbQmt6Z9G22gURfDLe30uV1ascbzqgdhg=",
  "fetchLFS": false,
  "fetchSubmodules": false,
  "deepClone": false,
  "leaveDotGit": false
}

If this section is wanted in the README.md I'm happy to also add documentation for bumping these values elsewhere!

Reference

@alpha-tango-kilo
Copy link
Collaborator

I've never got around to trying NixOS; is needing to use nix-prefetch fairly common for things that don't have formal nix packages? If it's quite common for users to have to do, in my opinion it's fine to leave more minimal instructions, and let the more advanced users sort themselves out, focussing on helping the newbies along

@zimeg
Copy link
Contributor Author

zimeg commented Jan 28, 2024

@alpha-tango-kilo Thanks for reviewing this! I've been diving into Nix as a package manager recently and it's been quite pleasant. Configurations are too much fun to mess with...

My understanding is that nix-prefetch helps find hash values for a specific package without needing to compute the hash yourself or face errors on the first attempt with an incorrect hash. Not super sure if using nix-prefetch is the common approach, but adding packages or plugins by URL and hash seems standard for projects that don't have a nix package.

I totally agree that more minimal instructions are fine too since the error is pretty helpful when the hash is wrong:

error: hash mismatch in fixed-output derivation '/nix/store/pykbkq771vmgjg9iksdssax0b90bp2ix-source.drv':
         specified: sha256-3yJ1qhqhNULbQmt6Z9G22gURfDLe30uV1ascbzqgdhg=
            got:    sha256-4yJ1qhqhNULbQmt6Z9G22gURfDLe30uV1ascbzqgdhg=

@alpha-tango-kilo alpha-tango-kilo merged commit 99050d8 into mfaerevaag:master Jan 29, 2024
1 check passed
@alpha-tango-kilo
Copy link
Collaborator

Cheers for explaining further! Happy to merge this as-is based on what you've said :) Thanks for the PRs

@zimeg zimeg deleted the home-manager branch January 30, 2024 00:18
@zimeg
Copy link
Contributor Author

zimeg commented Jan 30, 2024

@alpha-tango-kilo And thank you for maintaining this wonderful tool! I'm a big fan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants