]> Git — Sourcephile - julm/books.git/blob - flake.nix
init
[julm/books.git] / flake.nix
1 {
2 description = "books";
3 inputs = {
4 nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
5 pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
6 pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
7 };
8
9 outputs =
10 inputs:
11 let
12 inherit (inputs.nixpkgs) lib;
13 forAllSystems =
14 f:
15 lib.genAttrs lib.systems.flakeExposed (
16 system:
17 f rec {
18 inherit system;
19 pkgs = inputs.nixpkgs.legacyPackages.${system};
20 }
21 );
22 in
23 {
24 # nix -L build .#hello
25 packages = forAllSystems ({ pkgs, ... }: pkgs);
26
27 # nix -L develop or direnv allow
28 devShell = forAllSystems (
29 {
30 pkgs,
31 system,
32 ...
33 }:
34 pkgs.mkShell {
35 name = "shell";
36 src = null;
37 buildInputs = [
38 pkgs.fontconfig
39 #pkgs.gitFull
40 pkgs.jq
41 pkgs.pandoc
42 pkgs.reuse
43 pkgs.shellcheck
44 ];
45 inherit (inputs.self.checks.${system}.pre-commit-check) shellHook;
46 }
47 );
48
49 # nix flake check
50 checks = forAllSystems (
51 args: with args; {
52 pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
53 src = inputs.self;
54 hooks = {
55 nixfmt-rfc-style.enable = true;
56 };
57 };
58 }
59 );
60 };
61 }