sha256

Pure Haskell implementation of the SHA-256 hashing algorithm.
git clone git://git.ppad.tech/sha256.git
Log | Files | Refs | LICENSE

commit 5f284283c0bfb3925d2ff4010c3545a532b64cbf
Author: Jared Tobin <jared@jtobin.io>
Date:   Mon,  8 Apr 2024 17:00:28 +0400

nix: add flake skeleton

Diffstat:
Aflake.nix | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+), 0 deletions(-)

diff --git a/flake.nix b/flake.nix @@ -0,0 +1,59 @@ +{ + description = "ppad-sha256"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + lib = "ppad-sha256"; + + pkgs = import nixpkgs { inherit system; }; + hlib = pkgs.haskell.lib; + + hpkgs = pkgs.haskell.packages.ghc964; + # hpkgs = pkgs.haskell.packages.ghc964.override { + # overrides = new: old: { + # ${lib} = old.callCabal2nix lib ./. {}; + # }; + # }; + + cc = pkgs.stdenv.cc; + ghc = hpkgs.ghc; + cabal = hpkgs.cabal-install; + in + { + # packages.${lib} = hpkgs.${lib}; + + # defaultPackage = self.packages.${system}.${lib}; + + devShells.default = hpkgs.shellFor { + packages = p: [ ]; + # packages = p: [ + # (hlib.doBenchmark p.${lib}) + # ]; + + buildInputs = [ + cabal + cc + ]; + + # inputsFrom = builtins.attrValues self.packages.${system}; + + # doBenchmark = true; + + shellHook = '' + PS1="[${lib}] \w$ " + echo "entering ${system} shell, using" + echo "cc: $(${cc}/bin/cc --version)" + echo "ghc: $(${ghc}/bin/ghc --version)" + echo "cabal: $(${cabal}/bin/cabal --version)" + ''; + }; + } + ); +} +