Reshuffle the files for better nix organization
This commit is contained in:
1
site/.envrc
Normal file
1
site/.envrc
Normal file
@ -0,0 +1 @@
|
||||
use nix
|
30
site/LICENSE
Normal file
30
site/LICENSE
Normal file
@ -0,0 +1,30 @@
|
||||
Copyright (c) 2018, Mats Rauhala
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
* Neither the name of Mats Rauhala nor the names of other
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
41
site/app/site.hs
Normal file
41
site/app/site.hs
Normal file
@ -0,0 +1,41 @@
|
||||
--------------------------------------------------------------------------------
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
import Hakyll
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
main :: IO ()
|
||||
main = hakyllWith defaultConfiguration $ do
|
||||
match "well-known/*" $ do
|
||||
route (customRoute (prepend '.'. toFilePath))
|
||||
compile copyFileCompiler
|
||||
|
||||
match "images/*" $ do
|
||||
route idRoute
|
||||
compile copyFileCompiler
|
||||
|
||||
match "resources/*" $ do
|
||||
route idRoute
|
||||
compile copyFileCompiler
|
||||
|
||||
match "css/*" $ do
|
||||
route idRoute
|
||||
compile compressCssCompiler
|
||||
|
||||
match "js/*" $ do
|
||||
route idRoute
|
||||
compile compressCssCompiler
|
||||
|
||||
match (fromList ["index.markdown", "contact.markdown"]) $ do
|
||||
route $ setExtension "html"
|
||||
compile $ pandocCompiler
|
||||
>>= loadAndApplyTemplate "templates/default.html" defaultContext
|
||||
>>= relativizeUrls
|
||||
|
||||
|
||||
|
||||
match "templates/*" $ compile templateBodyCompiler
|
||||
|
||||
|
||||
prepend :: a -> [a] -> [a]
|
||||
prepend = (:)
|
10
site/default.nix
Normal file
10
site/default.nix
Normal file
@ -0,0 +1,10 @@
|
||||
{ mkDerivation, base, hakyll, stdenv, time }:
|
||||
mkDerivation {
|
||||
pname = "site";
|
||||
version = "0.1.0.0";
|
||||
src = ./.;
|
||||
isLibrary = false;
|
||||
isExecutable = true;
|
||||
executableHaskellDepends = [ base hakyll time ];
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}
|
16
site/shell.nix
Normal file
16
site/shell.nix
Normal file
@ -0,0 +1,16 @@
|
||||
with (import <nixpkgs> {});
|
||||
|
||||
let site = haskellPackages.callPackage ./. {};
|
||||
|
||||
in
|
||||
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
ghcid
|
||||
stylish-haskell
|
||||
haskellPackages.cabal-install
|
||||
hlint
|
||||
(haskellPackages.ghcWithPackages (_: site.buildInputs ++ site.propagatedBuildInputs))
|
||||
];
|
||||
}
|
||||
|
17
site/site.cabal
Normal file
17
site/site.cabal
Normal file
@ -0,0 +1,17 @@
|
||||
name: site
|
||||
version: 0.1.0.0
|
||||
build-type: Simple
|
||||
cabal-version: >= 1.10
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
author: Mats Rauhala
|
||||
maintainer: mats.rauhala@iki.fi
|
||||
|
||||
executable site
|
||||
main-is: site.hs
|
||||
hs-source-dirs: app
|
||||
build-depends: base == 4.*
|
||||
, hakyll >= 4.10
|
||||
, time
|
||||
ghc-options: -threaded
|
||||
default-language: Haskell2010
|
Reference in New Issue
Block a user