-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
56 lines (51 loc) · 1.46 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
54
55
56
{
description = "Jekyll website template";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
minima = pkgs.rubyPackages.minima;
minimaVersion = builtins.getAttr "version" minima;
minimaPath = "${minima}/lib/ruby/gems/3.1.0/gems/minima-${minimaVersion}/_sass";
in
{
formatter = pkgs.nixpkgs-fmt;
# development environment
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.ruby
pkgs.rubyPackages.jekyll
pkgs.rubyPackages.jekyll-sitemap
minima
];
shellHook = ''
if [ ! -d "${minimaPath}" ]; then
echo "Error: The SASS_PATH (${minimaPath}) does not exist."
exit 1
else
export SASS_PATH=${minimaPath}
fi
'';
};
packages.default = pkgs.stdenv.mkDerivation {
name = "jekyll-insalgo-website";
src = ./.;
buildInputs = [
pkgs.ruby
pkgs.jekyll
pkgs.rubyPackages.jekyll-sitemap
];
buildPhase = ''
jekyll build
'';
installPhase = ''
cp -r _site $out
'';
};
}
);
}