Skip to content
Draft
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
4 changes: 4 additions & 0 deletions docs/NIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,24 @@
## Project Structure

The project uses:

- Nix Flakes for reproducible builds and development environments
- `stacklock2nix` for deriving Nix packages from stack.yaml.lock
- `devenv` for creating consistent development environments

### Flake.nix

The flake.nix file has the following inputs:

- `nixpkgs`: Standard Nix packages repository
- `stacklock2nix`: A tool for generating Nix packages from stack.yaml.lock files

The flake outputs:

- `packages.default`: The Hapistrano package for each supported system
- `overlays.default`: An overlay for integrating Hapistrano into other Nix
systems
- `templates.default`: A template showing how to install Hapistrano using devenv

## Development Environments

Expand Down
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,9 @@
overlays.default = final: prev: {
hapistrano = self.packages.${prev.system}.default;
};
templates.default = {
description = "Install Hapistrano using devenv";
path = ./templates/default;
};
};
}
1 change: 1 addition & 0 deletions templates/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
devenv.lock
5 changes: 5 additions & 0 deletions templates/default/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export DIRENV_WARN_TIMEOUT=20s

eval "$(devenv direnvrc)"

use devenv
9 changes: 9 additions & 0 deletions templates/default/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml
10 changes: 10 additions & 0 deletions templates/default/devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ pkgs, ... }:

{
packages = [ pkgs.hapistrano ];

cachix = {
enable = true;
pull = [ "stackbuilders" ];
};
}
8 changes: 8 additions & 0 deletions templates/default/devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling
hapistrano:
url: github:stackbuilders/hapistrano
overlays:
- default
Loading