This commit is contained in:
nek0 2019-12-19 04:42:44 +01:00
parent 3a48087682
commit adf4e8e2b9
4 changed files with 47 additions and 33 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
dist
dist-newstyle
cabal-dev
*.o
*.hi
@ -17,3 +18,5 @@ cabal.sandbox.config
_cache/
_site/
drafts/
.ghc.*
.envrc

7
default.nix Normal file
View File

@ -0,0 +1,7 @@
{ pkgs ? import <nixpkgs> (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz))
, haskellCompiler ? "ghc865"
}:
pkgs.haskell-nix.cabalProject {
src = pkgs.haskell-nix.haskellLib.cleanGit { src = ./.; };
ghc = pkgs.buildPackages.pkgs.haskell-nix.compiler.${haskellCompiler};
}

View File

@ -1,35 +1,4 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
let
inherit (nixpkgs) pkgs;
f = { mkDerivation, base, directory, filepath, hakyll, HTTP
, stdenv, time
}:
mkDerivation {
pname = "nek0-blog";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
base directory filepath hakyll HTTP time
];
homepage = "https://nek0.eu";
description = "My blog";
license = stdenv.lib.licenses.unfree;
hydraPlatforms = stdenv.lib.platforms.none;
};
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
drv = variant (haskellPackages.callPackage f {});
hsPkgs = import ./default.nix {};
in
if pkgs.lib.inNixShell then drv.env else drv
hsPkgs.nek0-blog.components.all

35
shell.nix.bak Normal file
View File

@ -0,0 +1,35 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
let
inherit (nixpkgs) pkgs;
f = { mkDerivation, base, directory, filepath, hakyll, HTTP
, stdenv, time
}:
mkDerivation {
pname = "nek0-blog";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
base directory filepath hakyll HTTP time
];
homepage = "https://nek0.eu";
description = "My blog";
license = stdenv.lib.licenses.unfree;
hydraPlatforms = stdenv.lib.platforms.none;
};
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
drv = variant (haskellPackages.callPackage f {});
in
if pkgs.lib.inNixShell then drv.env else drv