aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
blob: 99e9192d03f8dafbf33a8865ec5df3debafa52e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  description = "vkcku's monorepo.";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";

    # keep-sorted start block=yes newline_separated=yes
    flake-parts.url = "github:hercules-ci/flake-parts";

    import-tree.url = "github:denful/import-tree";

    treefmt-nix = {
      url = "github:numtide/treefmt-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    # keep-sorted end
  };

  outputs =
    {
      nixpkgs,
      flake-parts,
      import-tree,
      ...
    }@inputs:
    let
      lib = nixpkgs.lib;
      directories = builtins.attrNames (
        lib.attrsets.filterAttrs (_: type: type == "directory") (builtins.readDir ./.)
      );
      paths = map (lib.path.append ./.) directories;
    in
    flake-parts.lib.mkFlake { inherit inputs; } (import-tree paths);
}