blog/flake.nix

58 lines
1.3 KiB
Nix
Raw Normal View History

2024-04-11 23:31:44 +00:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
utils,
}:
(utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in
{
formatter = pkgs.nixfmt-rfc-style;
packages.default = pkgs.artemist-blog;
shells.default = pkgs.mkShell {
buildInputs = pkgs.artemist-blog.buildInputs ++ (with pkgs; [ bundix ]);
};
}
))
// {
overlays.default = final: prev: {
artemist-blog =
let
jekyllEnv = final.bundlerEnv {
name = "artemist-blog-env";
inherit (final) ruby;
gemfile = ./Gemfile;
lockfile = ./Gemfile.lock;
gemset = ./gemset.nix;
};
in
final.stdenv.mkDerivation {
name = "artemist-blog";
src = ./.;
buildInputs = with final; [ jekyllEnv ];
buildPhase = ''
bundle exec jekyll build
'';
installPhase = ''
cp -r _site $out
'';
};
};
};
}