From c336d8b3a54cdc4ffe4ae07f49009395f54ca81f Mon Sep 17 00:00:00 2001 From: Jack Kelly Date: Wed, 26 Jun 2024 18:24:00 +1000 Subject: [PATCH] Use bellroy-nix-foss --- cached-io.nix | 25 ++++++------------- flake.nix | 67 +++++++++++++++------------------------------------ 2 files changed, 28 insertions(+), 64 deletions(-) diff --git a/cached-io.nix b/cached-io.nix index 6278143..beea4b7 100644 --- a/cached-io.nix +++ b/cached-io.nix @@ -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"; } diff --git a/flake.nix b/flake.nix index 77252d4..e607675 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; + }; }