Skip to content
Open
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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use devenv
3 changes: 1 addition & 2 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
- Build and test Haskell code
- [Draft](draft.yml)
- Create a GH draft release with a static binary
- [Release](release.yml)
- Upload the package and docs to Hackage (release candidate)


## Events

Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ cabal.config
*.hp
.stack-work/
.env
.direnv/
.devenv/
dist-newstyle/
18 changes: 0 additions & 18 deletions .releaserc

This file was deleted.

25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,31 @@ also install the library and executable by invoking `stack install dotenv` or
you can download the dotenv binaries from our
[releases](https://github.com/stackbuilders/dotenv-hs/releases) page.

## Development with devenv

This project includes a [devenv](https://devenv.sh/) setup for reproducible
local development.

1. Install Nix and devenv.
2. From the project root, run:

```shell
direnv allow
```
Comment on lines +38 to +40

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Djojavi devenv comes with a new feature for auto-loading, so we don't really need to use direnv anymore!


Or, if you are not using direnv:

```shell
devenv shell
```

Inside the shell you can use the normal project commands, for example:

```shell
cabal build
cabal test
```

## Usage

Set configuration variables in a file following the format below:
Expand Down
65 changes: 65 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1785352168,
"narHash": "sha256-m/9I5Ai3+wbJuKXtwwaFLG+4Db7Pg2EUYP3ZGLsA7xU=",
"owner": "cachix",
"repo": "devenv",
"rev": "bf3fde552a27d5e41c52c0fcfbf258e396c995bb",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"nixpkgs": {
"inputs": {
"nixpkgs-src": "nixpkgs-src"
},
"locked": {
"lastModified": 1785104946,
"narHash": "sha256-VLSslwCjlsICjyaUfrS7lGMypmO03fzmDAqhD85Ae84=",
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "c946ff36bf193309589932c371bd5ae6653c912e",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs-src": {
"flake": false,
"locked": {
"lastModified": 1784783405,
"narHash": "sha256-4IHyyLgLBdKefkljdKod4IMn023pQiDXAWJA187cmdY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7525d999cd850b9a488817abc89c75dc733acf17",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
21 changes: 21 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ pkgs, ... }:

{
# https://devenv.sh/reference/options/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# https://devenv.sh/reference/options/

packages = with pkgs; [
cabal-install
ghc
haskell-language-server
hlint
ormolu
stack
zlib
];
Comment on lines +5 to +13

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Djojavi What about using the language essentials that devenv provides for Haskell?


enterShell = ''
echo "dotenv-hs dev environment loaded"
echo "Try: cabal build && cabal test"
'';

languages.haskell.enable = true;
}
2 changes: 1 addition & 1 deletion dotenv.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: dotenv
version: 0.0.0.0
version: 0.12.0.0
synopsis: Loads environment variables from dotenv files
homepage: https://github.com/stackbuilders/dotenv-hs
description:
Expand Down
Loading