From f33535e9fc1de54f384f2006b1fd673da4557f11 Mon Sep 17 00:00:00 2001 From: Shaun Kerr Date: Tue, 4 Sep 2018 13:32:43 +1200 Subject: [PATCH] nix actually works for real now --- README.md | 15 +++++++-------- default.nix | 7 ++----- rf.nix | 17 +++++++++++++++-- shell.nix | 5 +++++ 4 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 shell.nix diff --git a/README.md b/README.md index 60c7d5b..870863b 100644 --- a/README.md +++ b/README.md @@ -20,23 +20,22 @@ curl https://nixos.org/nix/install | sh ### Installing -Enter the build environment - -``` -nix-shell --attr env rf.nix -``` - Compile the generator ``` nix-build rf.nix ``` +Enter the build environment + +``` +nix-shell --pure rf.nix +``` + Generate the site ``` -./result/site clean -./result/site build +./result/site rebuild ``` And test it out diff --git a/default.nix b/default.nix index be5c7f0..53261cc 100644 --- a/default.nix +++ b/default.nix @@ -1,14 +1,11 @@ -{ mkDerivation, base, binary, filepath, hakyll, hakyll-favicon, imagemagick -, stdenv -}: +{ mkDerivation, base, filepath, hakyll, hakyll-favicon, stdenv }: mkDerivation { pname = "rf"; version = "0.1.3.1"; src = ./.; isLibrary = false; isExecutable = true; - executableHaskellDepends = [ base binary filepath hakyll hakyll-favicon ]; - #executableSystemDepends = [ imagemagick ]; + executableHaskellDepends = [ base filepath hakyll hakyll-favicon ]; homepage = "regularflolloping.com"; description = "tA's blog"; license = stdenv.lib.licenses.bsd3; diff --git a/rf.nix b/rf.nix index ce3c00e..b223958 100644 --- a/rf.nix +++ b/rf.nix @@ -1,4 +1,17 @@ let - pkgs = import { }; + config = { + packageOverrides = pkgs: rec { + haskellPackages = pkgs.haskellPackages.override { + overrides = haskellPackagesNew: haskellPackagesOld: rec { + rf = + haskellPackagesNew.callPackage ./default.nix { }; + }; + }; + }; + }; + pkgs = import { inherit config; }; in - pkgs.haskellPackages.callPackage ./default.nix { } + rec { + inherit pkgs; + rf = pkgs.haskellPackages.rf; + } diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..2f2eb5f --- /dev/null +++ b/shell.nix @@ -0,0 +1,5 @@ +let + stuff = import ./rf.nix; +in stuff.rf.env.overrideAttrs (drv: { + buildInputs = drv.buildInputs ++ [ stuff.pkgs.imagemagick ]; +})