blog/flake.nix

72 lines
2 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;
2024-04-12 05:35:52 +00:00
devShells.default = pkgs.mkShell {
2024-04-11 23:31:44 +00:00
buildInputs = pkgs.artemist-blog.buildInputs ++ (with pkgs; [ bundix ]);
};
}
))
// {
overlays.default = final: prev: {
artemist-blog =
let
2024-04-12 05:35:52 +00:00
dartSass =
final.fetchurl
({
x86_64-linux = {
url = "https://github.com/sass/dart-sass/releases/download/1.75.0/dart-sass-1.75.0-linux-x64.tar.gz";
hash = "sha256-FTvUgQ+7YiD/F1nU1pQbzirNcfspMDua2bxuzjnDDig=";
};
aarch64-linux = {
url = "https://github.com/sass/dart-sass/releases/download/1.75.0/dart-sass-1.75.0-linux-arm64.tar.gz";
hash = "sha256-OXkxW2Vz1vWsV3eXPmY+nrijSGwSY3X3Kv6tKmfOmPs=";
};
}).${final.stdenv.hostPlatform.system};
2024-04-11 23:31:44 +00:00
jekyllEnv = final.bundlerEnv {
name = "artemist-blog-env";
inherit (final) ruby;
gemfile = ./Gemfile;
lockfile = ./Gemfile.lock;
gemset = ./gemset.nix;
2024-04-12 05:35:52 +00:00
gemConfig.sass-embedded = attrs: { DART_SASS = dartSass; };
2024-04-11 23:31:44 +00:00
};
in
final.stdenv.mkDerivation {
name = "artemist-blog";
src = ./.;
2024-04-12 05:35:52 +00:00
buildInputs = [ jekyllEnv ];
2024-04-11 23:31:44 +00:00
buildPhase = ''
bundle exec jekyll build
'';
installPhase = ''
cp -r _site $out
'';
};
};
};
}