Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Mic92/fast-flake-update
Update flake.lock with the latest commit of a local checkout
https://github.com/Mic92/fast-flake-update
build-with-buildbot flake nix
Last synced: 5 days ago
JSON representation
Update flake.lock with the latest commit of a local checkout
- Host: GitHub
- URL: https://github.com/Mic92/fast-flake-update
- Owner: Mic92
- Created: 2023-05-20T19:04:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-29T00:39:10.000Z (8 months ago)
- Last Synced: 2024-05-02T00:16:37.793Z (8 months ago)
- Topics: build-with-buildbot, flake, nix
- Language: Python
- Homepage:
- Size: 56.6 KB
- Stars: 22
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - Mic92/fast-flake-update - Update flake.lock with the latest commit of a local checkout (Python)
- awesome-starred - Mic92/fast-flake-update - Update flake.lock with the latest commit of a local checkout (Python)
README
# fast-flake-update
> Written next to a pool in Mahalapye, Botswana.
This tool improves the _efficiency_ of updating flake inputs in
[nix](https://nixos.org) from local git repository checkouts.When using `nix flake update` with inputs from GitHub or GitLab, the entire
archive needs to be re-downloaded for every commit change. This process becomes
especially slow for repositories like
[nixpkgs](https://github.com/NixOS/nixpkgs).`fast-flake-update` uses of a local git checkout for updating the flake lock.
Additionally, it adds the checkout to the nix store. This approach allows for
faster iterations when testing changes, significantly improving development
efficiency.This is conceptually similar to
`nix flake lock --update-input inputA ~/code/inputA` but avoids the round-trip
of pushing to a git remote, and then re-acquiring the git archive. Since this
copies to the store, and uses the same archive format, it results in the same
diff to `flake.lock`.## Usage
```
usage: fast-flake-update [-h] [--rev REV] inputname repoUpdate flake.lock with the latest commit of a local checkout
positional arguments:
inputname Name of the input in flake.lock to update
repo Path to the local checkoutoptions:
-h, --help show this help message and exit
--rev REV Revision to use
```## Example
Let's say you have a project with the following `flake.nix`:
```nix
{
description = "Your flake with the nixpkgs input";inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};outputs = { ... }: {
# ...
};
}
```Now you can quickly do some commits in your local nixpkgs fork that is located
at `../nixpkgs`. Then you can update your project's flake.lock to the same
commit like that:```
fast-flake-update nixpkgs ../nixpkgs
```## Installation
You can run fast-flake-update like this from the repository:
```
nix run github:Mic92/fast-flake-update nixpkgs ../nixpkgs
```