-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
46 lines (46 loc) · 1.34 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
harbor = {
url = "github:matsuyoshi30/harbor";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, harbor }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
blog = pkgs.stdenv.mkDerivation {
name = "blog";
src = builtins.filterSource
(path: type: !(type == ''directory'' &&
(baseNameOf path == ''themes'' ||
baseNameOf path == ''public'')))
./.;
buildPhase = ''
mkdir -p themes
ln -sfn ${harbor} themes/harbor
${pkgs.hugo}/bin/hugo --minify
'';
installPhase = ''
cp -r public $out
'';
meta = with pkgs.lib; {
description = ''the ii.nz blog'';
platforms = platforms.all;
};
};
in {
packages = {
blog = blog;
default = blog;
};
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ hello cowsay hugo];
shellHook = ''
mkdir -p themes
ln -sfn ${harbor} themes/harbor
'';
};
});
}