blog/flake.nix

80 lines
1.6 KiB
Nix
Raw Normal View History

2021-05-28 18:22:52 +02:00
{
description = "Ambroisie's blog";
inputs = {
futils = {
type = "github";
owner = "numtide";
repo = "flake-utils";
2023-08-05 00:18:24 +02:00
ref = "main";
2021-05-28 18:22:52 +02:00
};
nixpkgs = {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
2021-08-08 16:04:44 +02:00
ref = "nixpkgs-unstable";
2021-05-28 18:22:52 +02:00
};
2021-05-31 22:01:28 +02:00
pre-commit-hooks = {
type = "github";
owner = "cachix";
repo = "pre-commit-hooks.nix";
ref = "master";
inputs = {
flake-utils.follows = "futils";
nixpkgs.follows = "nixpkgs";
2022-12-26 18:11:46 +01:00
nixpkgs-stable.follows = "nixpkgs";
2021-05-31 22:01:28 +02:00
};
};
2021-05-28 18:22:52 +02:00
};
2021-05-31 22:01:28 +02:00
outputs = { self, futils, nixpkgs, pre-commit-hooks } @ inputs:
futils.lib.eachDefaultSystem (system:
2021-05-28 18:22:52 +02:00
let
inherit (nixpkgs) lib;
pkgs = nixpkgs.legacyPackages.${system};
in
{
2021-05-31 22:01:28 +02:00
checks = {
pre-commit = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt = {
enable = true;
};
markdown-lint = {
enable = true;
name = "Lint each post's markdown";
entry =
let
pkg = pkgs.nodePackages.markdownlint-cli;
in
"${pkg}/bin/markdownlint";
types = [ "markdown" ];
};
2021-05-31 22:01:28 +02:00
};
};
};
devShells = {
default = pkgs.mkShell {
name = "blog";
2021-05-28 18:22:52 +02:00
buildInputs = with pkgs; [
gnumake
hugo
];
2021-05-31 22:01:28 +02:00
inherit (self.checks.${system}.pre-commit) shellHook;
};
2021-05-28 18:22:52 +02:00
};
}
);
}