main
 1{
 2  inputs = {
 3    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
 4
 5    flake-utils.url = "github:numtide/flake-utils";
 6
 7    flake-compat.url = "github:NixOS/flake-compat";
 8
 9    treefmt-nix = {
10      url = "github:numtide/treefmt-nix";
11      inputs.nixpkgs.follows = "nixpkgs";
12    };
13  };
14
15  outputs = {
16    self,
17    nixpkgs,
18    flake-utils,
19    treefmt-nix,
20    ...
21  }:
22    flake-utils.lib.eachDefaultSystem (system: let
23      pkgs = nixpkgs.legacyPackages.${system};
24      treefmt = (treefmt-nix.lib.evalModule pkgs ./nix/treefmt.nix).config.build;
25    in {
26      formatter = treefmt.wrapper;
27
28      checks.formatting = treefmt.check self;
29
30      packages = {
31        default = pkgs.callPackage ./nix/package.nix {};
32      };
33
34      devShell = pkgs.mkShell {
35        nativeBuildInputs = with pkgs; [
36          hello
37        ];
38      };
39    });
40}