Browse Source

nix actually works for real now

master
Shaun Kerr 5 years ago
parent
commit
f33535e9fc
4 changed files with 29 additions and 15 deletions
  1. +7
    -8
      README.md
  2. +2
    -5
      default.nix
  3. +15
    -2
      rf.nix
  4. +5
    -0
      shell.nix

+ 7
- 8
README.md 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


+ 2
- 5
default.nix 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;


+ 15
- 2
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
- 0
shell.nix View File

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

Loading…
Cancel
Save