Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
description = "A Haskell implementation of the Tahoe-LAFS SSK cryptographic protocols";
inputs = {
# Nix Inputs
flake-utils.url = github:numtide/flake-utils;
hs-flake-utils.url = "git+https://whetstone.private.storage/jcalderone/hs-flake-utils.git?ref=main";
nixpkgs.follows = "hs-flake-utils/nixpkgs";
};
outputs = {
self,
nixpkgs,
flake-utils,
hs-flake-utils,
}: let
ulib = flake-utils.lib;
ghcVersion = "ghc8107";
in
ulib.eachSystem ["x86_64-linux" "aarch64-darwin"] (system: let
# Get a nixpkgs customized for this system
pkgs = import nixpkgs {
inherit system;
};
hslib = hs-flake-utils.lib {
inherit pkgs;
src = ./.;
compilerVersion = ghcVersion;
packageName = "tahoe-ssk";
};
in {
checks = hslib.checks {};
devShells = hslib.devShells {
extraBuildInputs = pkgs:
with pkgs; [
zlib
];
};
packages = hslib.packages {};
apps.hlint = hslib.apps.hlint {};
# Using the working directory of `nix run`, do a build with cabal and
# then run the test suite.
apps.cabal-test = {
type = "app";
program = "${
pkgs.writeShellApplication {
name = "cabal-build-and-test";
runtimeInputs = with pkgs; [pkg-config haskell.compiler.${ghcVersion} cabal-install];
text = ''
cabal update hackage.haskell.org
cabal build tests
cabal run tests
'';
}
}/bin/cabal-build-and-test";
};