Skip to content

Commit

Permalink
🧱 Add Nix flakes for building locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Snuggle committed Sep 26, 2024
1 parent b2e133a commit 7c54385
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
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};
in
{
formatter = pkgs.nixpkgs-fmt;
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.ruby
pkgs.jekyll
pkgs.rubyPackages.jekyll-redirect-from
pkgs.rubyPackages.github-pages
];
};

packages.default = pkgs.stdenv.mkDerivation {
name = "snugg.ie";
src = ./.;
buildInputs = [
pkgs.ruby
pkgs.jekyll
pkgs.rubyPackages.jekyll-redirect-from
pkgs.rubyPackages.github-pages
];
buildPhase = ''
jekyll build
'';
installPhase = ''cp -r _site $out'';
};
});
}

0 comments on commit 7c54385

Please sign in to comment.