~jack/jackkelly-name

ff39af8f767e63f2a948e0b27c81b6ac18ab250e — Jack Kelly 2 years ago f6ea927
Replace default.nix/shell.nix using flake-compat
2 files changed, 22 insertions(+), 32 deletions(-)

M default.nix
M shell.nix
M default.nix => default.nix +9 -19
@@ 1,19 1,9 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:

let

  inherit (nixpkgs) pkgs;

  baseHaskellPackages = if compiler == "default"
                           then pkgs.haskellPackages
                           else pkgs.haskell.packages.${compiler};

  haskellPackages = baseHaskellPackages.override {
    overrides = self: super: with pkgs.haskell.lib; {
      hakyll = doJailbreak (unmarkBroken super.hakyll);
    };
  };

  variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
in
  variant (haskellPackages.callPackage ./jackkelly-name.nix {})
(import (
  let
    lock = builtins.fromJSON (builtins.readFile ./flake.lock);
  in fetchTarball {
    url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
    sha256 = lock.nodes.flake-compat.locked.narHash; }
) {
    src =  ./.;
}).defaultNix

M shell.nix => shell.nix +13 -13
@@ 1,13 1,13 @@
{ nixpkgs ? import <nixpkgs> {}
, compiler ? "default"
}:

let
  inherit (nixpkgs) pkgs;
  env = (import ./default.nix { inherit nixpkgs compiler; }).env;
in
  env.overrideAttrs (oldAttrs: {
    buildInputs = with pkgs.haskellPackages; oldAttrs.buildInputs ++ [
      cabal-install ghcid
    ];
  })
(import
  (
    let
      lock = builtins.fromJSON (builtins.readFile ./flake.lock);
    in
    fetchTarball {
      url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
      sha256 = lock.nodes.flake-compat.locked.narHash;
    }
  )
  {
    src = ./.;
  }).shellNix