Skip to content

Commit

Permalink
replace shell.nix with haskell.nix Flake
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbecich committed Mar 5, 2023
1 parent e0e8f41 commit 495a54e
Show file tree
Hide file tree
Showing 11 changed files with 982 additions and 50 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Test nix-shell"
name: "Test Nix Flake"
on:
push:
branches:
Expand All @@ -15,7 +15,6 @@ jobs:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-21.11
extra_nix_config: |
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hackage-server.cachix.org-1:iw0iRh6+gsFIrxROFaAt5gKNgIHejKjIfyRdbpPYevY=
substituters = https://hydra.iohk.io https://cache.nixos.org/ https://hackage-server.cachix.org/
Expand All @@ -24,4 +23,5 @@ jobs:
# https://nix.dev/tutorials/continuous-integration-github-actions#setting-up-github-actions
name: hackage-server
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix-shell --pure --run ./.github/workflows/test-nix-shell.sh
- run: nix build
# - run: nix flake check
4 changes: 0 additions & 4 deletions .github/workflows/test-nix-shell.sh

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ tags
*.swp
TAGS
*~
.direnv
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

[![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/haskell-ci.yml/badge.svg)](https://github.com/haskell/hackage-server/actions/workflows/haskell-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)
[![Build status](https://github.com/haskell/hackage-server/actions/workflows/nix-flake.yml/badge.svg)](https://github.com/haskell/hackage-server/actions/workflows/nix-flake.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.

## Installing dependencies

`hackage-server` depends on `libgd` and `zlib`. You'll also need `libbrotli-dev` for enabling tests.

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

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:
If you have the [Nix package manager](https://nixos.org/) installed, the easiest way to run `hackage-server` is by using `nix develop`. It should be unnecessary to install any dependencies manually. In this repository:

nix-shell --pure
nix develop

[nix-shell]$ cabal v2-run -- hackage-server init
(in develop 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
$ 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
1 change: 0 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

packages: .


allow-newer: rss:time, rss:base

-- Andreas, 2022-10-28: `Cabal-3.8.1.0` wants `process >= 1.6.14`
Expand Down
Loading

0 comments on commit 495a54e

Please sign in to comment.