You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-50Lines changed: 13 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -13,65 +13,28 @@ You can use the Nix package manager to provide these dependencies, or install th
13
13
14
14
### Using the [Nix package manager](https://nixos.org/) and provided [Nix Flake](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html)
15
15
16
-
If you have the Nix package manager installed, you can build and run `hackage-server` without manually installing any dependencies.
16
+
If you have the Nix package manager installed, you can build and run `hackage-server` without manually installing any dependencies:
17
17
18
-
This uses `flake.nix`, implemented with [`srid/haskell-flake`](https://github.com/srid/haskell-flake).
18
+
$ nix run
19
19
20
-
There are at least three ways to use this `flake.nix`. Clone this repository, enter the repository directory, then choose one of these options:
This will produce a `hackage-server` executable in `result/`.
41
-
42
-
For this executable, Hackage dependencies are not pulled from Hackage directly like usual. Hackage dependencies are provided by the [Nixpkgs](https://search.nixos.org/packages)[`haskell-updates`](https://github.com/NixOS/nixpkgs/tree/haskell-updates) branch, and a few [overrides in `flake.nix`](https://zero-to-flakes.com/haskell-flake/dependency#using-hackage-versions).
`nix run` is more convenient to use than `nix build`.
47
-
48
-
As with `nix build`, Hackage dependencies are not pulled from Hackage directly like usual. See caveat above.
49
-
50
-
List the available [Flake Apps](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-run#apps) with [`nix flake show`](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-show.html):
51
-
52
-
$ nix flake show
53
-
...
54
-
├───apps
55
-
...
56
-
│ │ ├───hackage-build: app
57
-
│ │ ├───hackage-import: app
58
-
│ │ ├───hackage-mirror: app
59
-
│ │ └───hackage-server: app
60
-
...
25
+
The `flake.nix` is implemented with [`srid/haskell-flake`](https://github.com/srid/haskell-flake).
61
26
62
-
Run the `hackage-server` App:
27
+
Alternatively, open the [`nix develop`](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-develop.html) shell:
63
28
64
-
nix run .#hackage-server -- init --static-dir=datafiles
29
+
$ nix develop
65
30
66
-
nix run .#hackage-server -- run --static-dir=datafiles --base-uri=http://127.0.0.1:8080
31
+
(in develop shell)
67
32
68
-
The `.` refers to the `flake.nix` in your working directory. `#hackage-server` refers to the App specified in that `flake.nix`.
69
-
70
-
`hackage-server` is the default App, so those commands can be shortened:
0 commit comments