Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/nix-shell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# https://nix.dev/tutorials/continuous-integration-github-actions
name: "Test nix-shell"
on:
push:
branches:
- '**'
paths-ignore: []
pull_request:
paths-ignore: []

jobs:
nix-shell:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-21.11
- run: nix-shell --pure --run "cabal update && cabal build all --enable-tests"
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Build Status](https://travis-ci.org/haskell/hackage-server.png?branch=master)](https://travis-ci.org/haskell/hackage-server)
[![Build status](https://github.com/haskell/hackage-server/actions/workflows/ci.yml/badge.svg)](https://github.com/haskell/hackage-server/actions/workflows/ci.yml)
[![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)

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.

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

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

If you have the Nix package manager installed, the easiest way to obtain
`hackage-server`'s dependencies is using the Nix shell:
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:

nix-shell
nix-shell --pure

Note: `libbrotli-dev` has to be installed manually.
[nix-shell]$ cabal v2-run -- hackage-server init

[nix-shell]$ cabal v2-run -- hackage-server run --static-dir=datafiles/ --base-uri=http://127.0.0.1:8080
hackage-server: Ready! Point your browser at http://127.0.0.1:8080

### Manually

Expand Down
22 changes: 13 additions & 9 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
let
nixpkgs = builtins.fetchTarball {
# master on 2021-08-02
url = "https://github.com/NixOS/nixpkgs/archive/70e001f35cc363eb789ea0a04eff11b86c440ba3.tar.gz";
sha256 = "1mrhbcfa8kkx1qnax8xh41grinqiycl56wlws5vvrli8w0pzgl1r";
# master on 2022-05-14
url = "https://github.com/NixOS/nixpkgs/archive/1d370bd07399fb52cea6badfbffbc90ac9b0f8f0.tar.gz";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sha256 = "1ln4vwy185gwhbf4f8vanrlj4w4bhwrcsb2m8fnm99f4zqzvp7fs";
};

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

in
pkgs.mkShell {
buildInputs = [
buildInputs = with pkgs; [
# Haskell development
pkgs.cabal-install
pkgs.ghc
cabal-install
ghc

# Dependencies
pkgs.icu
pkgs.zlib
pkgs.brotli
glibc
icu67
zlib
openssl
cryptodev
pkg-config
brotli
];
}