-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
53 lines (52 loc) · 1.35 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
47
48
49
50
51
52
53
{
description = "My Hugo Blog as a Nix Flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.hugo-theme-etch = {
url = "github:LukasJoswiak/etch";
flake = false;
};
outputs = {
self,
nixpkgs,
flake-utils,
hugo-theme-etch,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
packages.blog = pkgs.stdenv.mkDerivation {
name = "blog";
src = ./blog;
buildPhase = ''
mkdir -p themes
ln -s ${hugo-theme-etch} themes/etch
${pkgs.hugo}/bin/hugo --minify
'';
installPhase = ''
cp -r public $out
'';
meta = with pkgs.lib; {
description = "Things I consider interesting";
license = licenses.mit;
platforms = platforms.all;
};
};
packages.home = pkgs.stdenv.mkDerivation {
name = "home";
src = ./home;
installPhase = ''
cp -r . $out
'';
meta = with pkgs.lib; {
description = "My personal Website";
license = licenses.mit;
platforms = platforms.all;
};
};
devShell = pkgs.mkShell {
nativeBuildInputs = [pkgs.hugo];
buildInputs = [];
};
});
}