Skip to content

Commit 358d34f

Browse files
authored
update nix-shell sources; GitHub Actions for nix-shell (#1002)
* update `nix-shell` sources; use `niv` * nix readme update * don't use `niv`
1 parent 62804a3 commit 358d34f

File tree

3 files changed

+40
-14
lines changed

3 files changed

+40
-14
lines changed

.github/workflows/nix-shell.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# https://nix.dev/tutorials/continuous-integration-github-actions
2+
name: "Test nix-shell"
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
paths-ignore: []
8+
pull_request:
9+
paths-ignore: []
10+
11+
jobs:
12+
nix-shell:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/[email protected]
16+
- uses: cachix/install-nix-action@v16
17+
with:
18+
nix_path: nixpkgs=channel:nixos-21.11
19+
- run: nix-shell --pure --run "cabal update && cabal build all --enable-tests"

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Build Status](https://travis-ci.org/haskell/hackage-server.png?branch=master)](https://travis-ci.org/haskell/hackage-server)
44
[![Build status](https://github.com/haskell/hackage-server/actions/workflows/ci.yml/badge.svg)](https://github.com/haskell/hackage-server/actions/workflows/ci.yml)
5+
[![Build status](https://github.com/haskell/hackage-server/actions/workflows/nix-shell.yml/badge.svg)](https://github.com/haskell/hackage-server/actions/workflows/nix-shell.yml)
56

67
This is the `hackage-server` code. This is what powers <http://hackage.haskell.org>, and many other private hackage instances. The `master` branch is suitable for general usage. Specific policy and documentation for the central hackage instance exists in the `central-server` branch.
78

@@ -14,14 +15,16 @@ of libraries that provide Unicode and Globalization support.
1415
The [text-icu](https://hackage.haskell.org/package/text-icu) Haskell package
1516
uses the [icu4c](http://icu-project.org/apiref/icu4c/) library to build.
1617

17-
### Nix shell
18+
### [`nix-shell`](https://nixos.org/manual/nix/stable/command-ref/nix-shell.html)
1819

19-
If you have the Nix package manager installed, the easiest way to obtain
20-
`hackage-server`'s dependencies is using the Nix shell:
20+
If you have the [Nix package manager](https://nixos.org/) installed, the easiest way to run `hackage-server` is by using the `nix-shell`. It should be unnecessary to install any dependencies manually. In this repository:
2121

22-
nix-shell
22+
nix-shell --pure
2323

24-
Note: `libbrotli-dev` has to be installed manually.
24+
[nix-shell]$ cabal v2-run -- hackage-server init
25+
26+
[nix-shell]$ cabal v2-run -- hackage-server run --static-dir=datafiles/ --base-uri=http://127.0.0.1:8080
27+
hackage-server: Ready! Point your browser at http://127.0.0.1:8080
2528

2629
### Manually
2730

shell.nix

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
let
22
nixpkgs = builtins.fetchTarball {
3-
# master on 2021-08-02
4-
url = "https://github.com/NixOS/nixpkgs/archive/70e001f35cc363eb789ea0a04eff11b86c440ba3.tar.gz";
5-
sha256 = "1mrhbcfa8kkx1qnax8xh41grinqiycl56wlws5vvrli8w0pzgl1r";
3+
# master on 2022-05-14
4+
url = "https://github.com/NixOS/nixpkgs/archive/1d370bd07399fb52cea6badfbffbc90ac9b0f8f0.tar.gz";
5+
sha256 = "1ln4vwy185gwhbf4f8vanrlj4w4bhwrcsb2m8fnm99f4zqzvp7fs";
66
};
77

88
pkgs = import nixpkgs { config = { }; };
99

1010
in
1111
pkgs.mkShell {
12-
buildInputs = [
12+
buildInputs = with pkgs; [
1313
# Haskell development
14-
pkgs.cabal-install
15-
pkgs.ghc
14+
cabal-install
15+
ghc
1616

1717
# Dependencies
18-
pkgs.icu
19-
pkgs.zlib
20-
pkgs.brotli
18+
glibc
19+
icu67
20+
zlib
21+
openssl
22+
cryptodev
23+
pkg-config
24+
brotli
2125
];
2226
}

0 commit comments

Comments
 (0)