Skip to content

Commit

Permalink
Use bellroy-nix-foss
Browse files Browse the repository at this point in the history
  • Loading branch information
JackKelly-Bellroy committed Jun 26, 2024
1 parent 5dc681c commit c336d8b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 64 deletions.
25 changes: 8 additions & 17 deletions cached-io.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
{ mkDerivation
, lib
, base
, exceptions
, stm
, time
, transformers
}:
{ mkDerivation, base, exceptions, lib, stm, time, transformers }:
mkDerivation {
pname = "cached-io";
version = "1.1.0.0";
version = "1.3.0.0";
src = ./.;
libraryHaskellDepends = [
base
exceptions
stm
time
transformers
];
description = "A simple library to cache a single IO action with timeout";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [ base exceptions stm time transformers ];
executableHaskellDepends = [ base ];
description = "A simple library to cache IO actions";
license = lib.licenses.asl20;
mainProgram = "test-cachedIO";
}
67 changes: 20 additions & 47 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,26 @@
description = "A simple library to cache a single IO action with timeout";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs";
bellroy-nix-foss.url = "github:bellroy/bellroy-nix-foss";
};

outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
rec
{
# This becomes the list of package and devShell names.
supportedCompilers = [
"ghc88"
"ghc810"
"ghc90"
"ghc92"
"ghc94"
"ghc96"
"ghc98"
];

packages = builtins.listToAttrs (
builtins.map
(compiler: {
name = compiler;
value = pkgs.haskell.packages.${compiler}.callPackage ./cached-io.nix { };
})
supportedCompilers
);

devShells' = (builtins.mapAttrs
(compiler: v: v.env.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs
++ [ pkgs.nixpkgs-fmt ]
++ (with pkgs.haskell.packages.${compiler}; [
cabal-fmt
cabal-install
doctest
haskell-ci
haskell-language-server
hlint
]);
}))
packages
);

devShells = devShells' // { default = devShells'.ghc92; };
});
outputs = inputs:
inputs.bellroy-nix-foss.lib.haskellProject {
cabalPackages = [
{
name = "cached-io";
path = ./cached-io.nix;
}
];
supportedCompilers = [
"ghc810"
"ghc90"
"ghc92"
"ghc94"
"ghc96"
"ghc98"
"ghc910"
];
defaultCompiler = "ghc96";
};
}

0 comments on commit c336d8b

Please sign in to comment.