diff options
-rw-r--r-- | default.nix | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/default.nix b/default.nix index df8b45f..ae05252 100644 --- a/default.nix +++ b/default.nix @@ -1,7 +1,8 @@ let - pkgs = import <nixpkgs> {}; + pkgs = import <nixpkgs> { }; rootSrc = pkgs.nix-gitignore.gitignoreSource [] ./.; - nixfmt = import (builtins.fetchTarball https://github.com/serokell/nixfmt/archive/master.tar.gz) {}; + nixfmt = import (builtins.fetchTarball + "https://github.com/serokell/nixfmt/archive/master.tar.gz") { }; # Taken from: # http://www.cs.yale.edu/homes/lucas.paul/posts/2017-04-10-hakyll-on-nix.html @@ -9,9 +10,8 @@ let name = "website-builder"; src = ./hakyll; phases = "unpackPhase buildPhase"; - buildInputs = [ - (pkgs.haskellPackages.ghcWithPackages (p: with p; [ hakyll ])) - ]; + buildInputs = + [(pkgs.haskellPackages.ghcWithPackages (p: with p; [hakyll]))]; buildPhase = '' mkdir -p $out/bin ghc -O2 -dynamic --make Main.hs -o $out/bin/build-site @@ -20,41 +20,42 @@ let baseTask = pkgs.stdenv.mkDerivation { name = "website-task"; src = rootSrc; - buildInputs = [ pkgs.perl ]; + buildInputs = [pkgs.perl]; phases = "unpackPhase buildPhase"; buildPhase = '' echo "ERROR: base task buildPhase not overriden." exit 1 ''; }; -in with pkgs; with pkgs.stdenv; rec { +in with pkgs; +with pkgs.stdenv; rec { subtasks = rec { - fixme = baseTask.overrideAttrs(baseAttrs: { + fixme = baseTask.overrideAttrs (baseAttrs: { name = "${baseAttrs.name}-fixme"; - buildInputs = baseAttrs.buildInputs ++ [ ag ]; + buildInputs = baseAttrs.buildInputs ++ [ag]; buildPhase = '' ag FIXME --ignore default.nix --ignore pastebin/skeleton.org || { touch $out } ''; }); - perlPodCheck = baseTask.overrideAttrs(baseAttrs: { + perlPodCheck = baseTask.overrideAttrs (baseAttrs: { name = "${baseAttrs.name}-perl-podcheck"; buildPhase = '' podchecker website pastebin/website-pastebin slides/website-slides touch $out ''; }); - batsTest = baseTask.overrideAttrs(baseAttrs: { + batsTest = baseTask.overrideAttrs (baseAttrs: { name = "${baseAttrs.name}-bats-test"; - buildInputs = baseAttrs.buildInputs ++ [ bats ]; + buildInputs = baseAttrs.buildInputs ++ [bats]; buildPhase = '' patchShebangs . ./t/website.bats touch $out ''; }); - perlInternalTest = baseTask.overrideAttrs(baseAttrs: { + perlInternalTest = baseTask.overrideAttrs (baseAttrs: { name = "${baseAttrs.name}-perl-test"; buildPhase = '' patchShebangs . @@ -62,7 +63,7 @@ in with pkgs; with pkgs.stdenv; rec { touch $out ''; }); - docs = baseTask.overrideAttrs(baseAttrs: { + docs = baseTask.overrideAttrs (baseAttrs: { name = "${baseAttrs.name}-docs"; buildInputs = [ websiteBuilder pandoc ]; buildPhase = '' @@ -78,7 +79,7 @@ in with pkgs; with pkgs.stdenv; rec { ''; }); }; - test = baseTask.overrideAttrs(baseAttrs: rec { + test = baseTask.overrideAttrs (baseAttrs: rec { name = "${baseAttrs.name}-test"; buildInputs = [ subtasks.fixme @@ -99,7 +100,7 @@ in with pkgs; with pkgs.stdenv; rec { name = "website-shell"; buildInputs = [ websiteBuilder - (pkgs.haskellPackages.ghcWithPackages (p: with p; [ hakyll ])) + (pkgs.haskellPackages.ghcWithPackages (p: with p; [hakyll])) nixfmt ]; }; |