Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akirak/flake-no-path
Detect local paths in flake.lock
https://github.com/akirak/flake-no-path
Last synced: 7 days ago
JSON representation
Detect local paths in flake.lock
- Host: GitHub
- URL: https://github.com/akirak/flake-no-path
- Owner: akirak
- License: mit
- Created: 2021-12-19T01:04:34.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-09-16T03:47:22.000Z (about 2 months ago)
- Last Synced: 2024-09-16T05:16:05.794Z (about 2 months ago)
- Language: Nix
- Size: 42 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flake-no-path for Nix
This script checks `path:` references in `flake.lock` files. If there is any node that is locked to an absolute path, it will cause a non-zero exit.
`flake.lock` can be either given as arguments or searched recursively from the working directory.
## Usage
```sh
nix run github:akirak/flake-no-path -- [FILE...]
```You can combine it with [pre-commit-hooks.nix](https://github.com/cachix/pre-commit-hooks.nix/).
[Example](https://github.com/akirak/flake-no-path/blob/master/flake.nix):
```nix
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
nix-linter.enable = true;
flake-no-path = {
enable = true;
name = "Ensure that flake.lock does not contain a local path";
entry = "${flake-no-path}/bin/flake-no-path";
files = "flake\.lock$";
pass_filenames = true;
};
};
};
```