Skip to content

Commit e910902

Browse files
DavidMazarroCristhianMotochesestrella
authoredOct 1, 2024··
Simplification of Nix flake and removal of GHC 8 (#245)
Co-authored-by: CristhianMotoche <[email protected]> Co-authored-by: Sebastián Estrella <[email protected]>
1 parent 0cf8b70 commit e910902

File tree

8 files changed

+97
-142
lines changed

8 files changed

+97
-142
lines changed
 

‎.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

‎.github/workflows/build.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ jobs:
1515
- macos-13 # x86_64-darwin
1616
- macos-latest # aarch64-darwin
1717
- ubuntu-latest # x86_64-linux
18-
ghc:
19-
- ghc8107
20-
- ghc902
2118
fail-fast: true
2219
runs-on: ${{ matrix.os }}
2320
timeout-minutes: 30
@@ -28,9 +25,9 @@ jobs:
2825
extra-conf: accept-flake-config = true
2926
- uses: DeterminateSystems/magic-nix-cache-action@v7
3027
- name: Compile code ${{ matrix.ghc }}
31-
run: nix build .#test-${{ matrix.ghc }}
28+
run: nix build .#test
3229
- name: Run tests ${{ matrix.ghc }}
33-
run: nix run .#test-${{ matrix.ghc }}
30+
run: nix run .#test
3431

3532
docker:
3633
uses: ./.github/workflows/reusable-docker.yml

‎.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*.o
77
.cabal-sandbox/
88
.direnv/
9-
.envrc
109
.hpc
1110
.hsenv
1211
.tool-versions

‎Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM utdemir/ghc-musl:v24-ghc902 AS build
1+
FROM quay.io/benz0li/ghc-musl:9.6.6 AS build
22
WORKDIR /usr/src/app
33
COPY hapistrano.cabal .
44
RUN cabal update && \
@@ -8,7 +8,7 @@ RUN cabal build --enable-executable-static && \
88
cp $(cabal exec which hap) hap
99

1010
FROM alpine:3.15
11-
MAINTAINER Nicolas Vivar <nvivar@stackbuilders.com>
11+
MAINTAINER Cristhian Motoche <cmotoche@stackbuilders.com>
1212
RUN apk update && \
1313
apk add \
1414
ca-certificates \

‎docs/NIX.md

+10-23
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,27 @@ sudo launchctl start org.nixos.nix-daemon
2222
```
2323

2424
If the following messages appear running the scripts detailed in the section
25-
below, it means that the Nix is not able to talk with the cache, in which case
26-
is recommended to go over the steps detailed in this section again:
25+
below, it means that Nix is not picking up the substituters we described
26+
earlier and is unable to use them as a derivation cache:
2727

2828
```
2929
warning: ignoring untrusted substituter 'https://cache.iog.io'
3030
```
31+
in which case
32+
it is recommended to go over the steps detailed in this section again, or look for alternative ways to add extra substituters in [nix.conf](https://nix.dev/manual/nix/2.18/command-ref/conf-file).
3133

32-
## Switching between different GHC versions
34+
## Enabling the development environment
3335

34-
The `bin` directory, holds all available shells:
36+
To enable the development environment exposed by the project's [Nix flake](../flake.nix), you can start a development shell by running the following command from within the project's root:
3537

3638
```
37-
ls bin | grep ghc
39+
nix develop
3840
```
3941

40-
To spawn a new shell with a pre-defined GHC version, choose one of the scripts
41-
listed above and run the following command:
42+
Alternatively, if you are using [nix-direnv](https://github.com/nix-community/nix-direnv) (recommended), you can run:
4243

43-
```sh
44-
./bin/ghc90
4544
```
46-
47-
Once inside the shell, verify the GHC version matches the script name:
48-
49-
```
50-
ghc --version
45+
direnv allow
5146
```
5247

53-
After that, all commands detailed in the [Getting
54-
Started](../README.md#getting-started) section should work the same.
55-
56-
Alternatively, to run a command without spawning a new shell use the `-c`
57-
option:
58-
59-
```sh
60-
./bin/ghc90 -c <command>
61-
```
48+
that will enable the development shell according to the contents of [.envrc](../.envrc). It is advisable not to run `direnv allow` blindly and always check the contents of [.envrc](../.envrc) files first to ensure nothing malicious is executed.

‎flake.lock

+57-61
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.