Skip to content

Fix Nix SHA's automatically via hooks.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

cachebag/fixsha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fixsha

Hook to automatically build a Nix derivation, detect if cargoHash was changed and update package.nix accordingly.

I know this exists somewhere but it took me less time to build a solution for my needs than to use the convuluted mess that's offered elsewhere.

Install

cargo install fixsha

Usage

This assumes that your projects root has a default.nix and package.nix:

fixsha

Git Hook

To automatically fix hashes before committing, paste this into .git/hooks/pre-commit:

#!/bin/sh
fixsha
if [ -f package.nix ]; then
    git add package.nix
fi

Make it executable:

chmod +x .git/hooks/pre-commit

Now fixsha runs on every commit and stages any hash updates automatically.

License

MIT OR Apache-2.0, your choice.

About

Fix Nix SHA's automatically via hooks.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks