Skip to content

Commit fe7f6ec

Browse files
author
jade
committed
Merge pull request 'Update readme' (#67) from cobaltcause/flake-compat:readme into main
Reviewed-on: https://git.lix.systems/lix-project/flake-compat/pulls/67
2 parents 33a2aba + e44e6cf commit fe7f6ec

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

README.md

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,28 @@
22

33
## Usage
44

5-
> [!WARNING]
6-
> During the Lix private beta period during which Forgejo is private, this
7-
> requires configuring netrc in Lix for the tarball download to work.
8-
>
9-
> Your netrc should look something like so:
10-
> ```
11-
> machine git.lix.systems login YOUR-USERNAME password SOME-PERSONAL-ACCESS-TOKEN-REPO-READ
12-
> ```
13-
>
14-
> We are terribly sorry for the UX for this being very bad
15-
> ([issue](https://git.lix.systems/lix-project/lix/issues/254)).
16-
175
To use, add the following to your `flake.nix`:
186

19-
<!-- FIXME: this can use the standard non-api archive url when we are
20-
un-privated -->
21-
227
```nix
23-
inputs.flake-compat.url = "https://git.lix.systems/api/v1/repos/lix-project/flake-compat/archive/main.tar.gz";
8+
inputs.flake-compat = {
9+
url = "git+https://git.lix.systems/lix-project/flake-compat";
10+
# Optional:
11+
flake = false;
12+
};
2413
```
2514

2615
Afterwards, create a `default.nix` file containing the following:
2716

2817
```nix
2918
(import
3019
(
31-
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
32-
fetchTarball {
33-
url = lock.nodes.flake-compat.locked.url;
34-
sha256 = lock.nodes.flake-compat.locked.narHash;
20+
let
21+
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
22+
inherit (lock.nodes.flake-compat.locked) narHash rev url;
23+
in
24+
builtins.fetchTarball {
25+
url = "${url}/archive/${rev}.tar.gz";
26+
sha256 = narHash;
3527
}
3628
)
3729
{ src = ./.; }

0 commit comments

Comments
 (0)