-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
166 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,78 @@ | ||
let | ||
# Nix configuration for redact | ||
# | ||
# Usage: | ||
# | ||
# * Build redact with the default compiler: | ||
# | ||
# $ nix-build | ||
# | ||
# * Build redact with a specific compiler version: | ||
# | ||
# $ nix-build --argstr compiler ghc901 | ||
|
||
nixpkgsRev = "c92ca95afb5043bc6faa0d526460584eccff2277"; | ||
compilerVersion = "ghc8104"; | ||
{ # This string argument specifies the compiler (example: "ghc8104"). When | ||
# not specified, the default compiler (configured below) is used. | ||
compiler ? null | ||
# This path argument specifies the packages to use. When not specified, a | ||
# working revision for the selected compiler is used. When a working | ||
# revision for the selected compiler is not defined (below), the packages | ||
# configured on the filesystem are used. | ||
, nixpkgs ? null | ||
# This boolean argument is used by `shell.nix`. When `True`, build tools | ||
# are added to the derivation. | ||
, isShell ? false | ||
}: | ||
|
||
githubTarball = owner: repo: rev: | ||
builtins.fetchTarball { url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; }; | ||
let | ||
|
||
gitIgnore = pkgs.nix-gitignore.gitignoreSourcePure; | ||
# This string defines the default compiler version. | ||
defaultCompiler = "ghc8104"; | ||
|
||
config = { | ||
packageOverrides = super: let self = super.pkgs; in rec { | ||
haskell = super.haskell // { | ||
packageOverrides = self: super: { | ||
haskell-nix = super.callCabal2nix "haskell-nix" (gitIgnore [./.gitignore] ./.) {}; | ||
}; | ||
}; | ||
}; | ||
# This set defines working revisions for supported compiler versions. | ||
nixpkgsRevs = { | ||
ghc901 = "4d4fdc329285e0d0c1c1a2b65947d651b8ba6b29"; | ||
ghc8104 = "c92ca95afb5043bc6faa0d526460584eccff2277"; | ||
ghc884 = "c92ca95afb5043bc6faa0d526460584eccff2277"; | ||
ghc865 = "2d9888f61c80f28b09d64f5e39d0ba02e3923057"; | ||
ghc844 = "6a80140fdf2157d1a5500a04c87033c0dcd6bf9b"; | ||
ghc822 = "6a80140fdf2157d1a5500a04c87033c0dcd6bf9b"; | ||
}; | ||
|
||
pkgs = import (githubTarball "NixOS" "nixpkgs" nixpkgsRev) { inherit config; }; | ||
compilerSet = pkgs.haskell.packages."${compilerVersion}"; | ||
# This function fetches the specified nixpkgs revision. | ||
nixpkgsTarball = rev: | ||
builtins.fetchTarball { | ||
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; | ||
}; | ||
|
||
in { | ||
# The compiler is explicitly specified or the default. | ||
compiler' = if isNull compiler then defaultCompiler else compiler; | ||
|
||
inherit pkgs; | ||
# Packages are explicitly specified, those for the revision defined for the | ||
# selected compiler, or those configured on the filesystem. | ||
pkgs = if isNull nixpkgs | ||
then if nixpkgsRevs ? ${compiler'} | ||
then import (nixpkgsTarball nixpkgsRevs.${compiler'}) {} | ||
else import <nixpkgs> {} | ||
else nixpkgs; | ||
|
||
shell = compilerSet.shellFor { | ||
packages = p: [p.haskell-nix]; | ||
buildInputs = with pkgs; [ | ||
compilerSet.cabal-install | ||
]; | ||
}; | ||
# Git ignore functionality from a fixed `nixpkgs` revision is used. Old | ||
# revisions do not work, proably due to an API change. The `ghc901` build | ||
# fails if that revision is not used. | ||
gitIgnore = ( | ||
import (nixpkgsTarball nixpkgsRevs.ghc901) {} | ||
).nix-gitignore.gitignoreSourcePure; | ||
|
||
in | ||
|
||
} | ||
# Configure the development environment for the package using the selected | ||
# packages and compiler. | ||
pkgs.haskell.packages.${compiler'}.developPackage { | ||
root = gitIgnore [./.gitignore] ./.; | ||
name = "redact"; | ||
modifier = drv: | ||
if isShell | ||
then pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages; | ||
[ cabal-install | ||
]) | ||
else drv; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# `redact-haskell` `0.3.0.0` Release Notes | ||
|
||
Date | ||
: 2021-06-25 | ||
|
||
## Overview | ||
|
||
This release of `redact` fixes a bug and makes changes to the [Nix][] | ||
configuration. There are no changes to the `redact` CLI. | ||
|
||
[Nix]: <https://nixos.org/> | ||
|
||
### Big Fix | ||
|
||
This release includes a fix for a bug that broke `--help` output. The issue | ||
only affected builds using `optparse-applicative` `0.16`, so none of the | ||
published builds were affected. | ||
|
||
### Nix Configuration | ||
|
||
The Nix configuration now supports testing against the following GHC versions | ||
using known working `nixpkgs` revisions: | ||
|
||
* GHC 8.2.2 | ||
* GHC 8.4.4 | ||
* GHC 8.6.5 | ||
* GHC 8.8.4 | ||
* GHC 8.10.4 | ||
* GHC 9.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,23 @@ | ||
(import ./default.nix).shell | ||
# Nix shell configuration for redact development | ||
# | ||
# Usage: | ||
# | ||
# * Run a Nix shell with the default compiler: | ||
# | ||
# $ nix-shell | ||
# | ||
# * Run a Nix shell with a specific compiler version: | ||
# | ||
# $ nix-shell --argstr compiler ghc901 | ||
|
||
{ # This string argument specifies the compiler (example: "ghc8104"). When | ||
# not specified, the default compiler is used. | ||
compiler ? null | ||
# This path argument specifies the packages to use. When not specified, a | ||
# working revision for the selected compiler is used. When a working | ||
# revision for the selected compiler is not defined (below), the packages | ||
# configured on the filesystem are used. | ||
, nixpkgs ? null | ||
}@args: | ||
|
||
import ./default.nix (args // { isShell = true; }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
resolver: lts-17.13 | ||
resolver: lts-18.0 | ||
|
||
packages: | ||
- . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,4 @@ | ||
compiler: ghc-9.0.1 | ||
|
||
setup-info: | ||
ghc: | ||
linux64-tinfo6: | ||
9.0.1: | ||
url: https://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-x86_64-deb10-linux.tar.xz | ||
content-length: 215436964 | ||
sha1: b5bdbac29dfcb73e0d74002ac91b7b9cc2d72d1f | ||
|
||
resolver: nightly-2021-05-26 | ||
resolver: nightly-2021-06-24 | ||
|
||
packages: | ||
- . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Nix configuration for testing redact against all supported GHC versions | ||
# | ||
# Usage: | ||
# | ||
# $ nix-build test-all.nix | ||
|
||
{ | ||
redact-ghc-822 = import ./default.nix { compiler = "ghc822"; }; | ||
redact-ghc-844 = import ./default.nix { compiler = "ghc844"; }; | ||
redact-ghc-865 = import ./default.nix { compiler = "ghc865"; }; | ||
redact-ghc-884 = import ./default.nix { compiler = "ghc884"; }; | ||
redact-ghc-8104 = import ./default.nix { compiler = "ghc8104"; }; | ||
redact-ghc-901 = import ./default.nix { compiler = "ghc901"; }; | ||
} |