Add shell.nix
This commit is contained in:
parent
974433f232
commit
e883be8c97
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1,3 @@
|
||||
.hugo_build.lock
|
||||
.direnv
|
||||
.pre-commit-config.yaml
|
||||
|
17
flake.nix
Normal file
17
flake.nix
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
description = "cronyakatsuki.xyz";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, pre-commit-hooks, ... }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
devShells.x86_64-linux.default =
|
||||
(import ./shell.nix { inherit pkgs pre-commit-hooks; });
|
||||
};
|
||||
}
|
15
shell.nix
Normal file
15
shell.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ pkgs ? import <nixpkgs> { }, pre-commit-hooks }:
|
||||
let
|
||||
pre-commit-check = pre-commit-hooks.lib.${pkgs.system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
shfmt.enable = true;
|
||||
html-tidy.enable = true;
|
||||
taplo.enable = true;
|
||||
};
|
||||
};
|
||||
in pkgs.mkShell {
|
||||
inherit (pre-commit-check) shellHook;
|
||||
name = "cronyakatsuki.xyz";
|
||||
nativeBuildInputs = [ pkgs.hugo ];
|
||||
}
|
Loading…
Reference in New Issue
Block a user