nix actually works for real now

This commit is contained in:
Shaun Kerr 2018-09-04 13:32:43 +12:00
parent 79c6e47845
commit f33535e9fc
4 changed files with 29 additions and 15 deletions

View File

@ -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

View File

@ -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;

17
rf.nix
View File

@ -1,4 +1,17 @@
let
pkgs = import <nixpkgs> { };
config = {
packageOverrides = pkgs: rec {
haskellPackages = pkgs.haskellPackages.override {
overrides = haskellPackagesNew: haskellPackagesOld: rec {
rf =
haskellPackagesNew.callPackage ./default.nix { };
};
};
};
};
pkgs = import <nixpkgs> { inherit config; };
in
pkgs.haskellPackages.callPackage ./default.nix { }
rec {
inherit pkgs;
rf = pkgs.haskellPackages.rf;
}

5
shell.nix Normal file
View File

@ -0,0 +1,5 @@
let
stuff = import ./rf.nix;
in stuff.rf.env.overrideAttrs (drv: {
buildInputs = drv.buildInputs ++ [ stuff.pkgs.imagemagick ];
})