2023-12-09 18:00:00 +01:00
|
|
|
# SPDX-FileCopyrightText: 2023 Hoang Nguyen <folliekazetani@protonmail.com>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2024-01-04 18:00:00 +01:00
|
|
|
|
|
|
|
flake-parts = {
|
|
|
|
url = "github:hercules-ci/flake-parts";
|
|
|
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
|
|
|
};
|
2023-12-09 18:00:00 +01:00
|
|
|
|
|
|
|
treefmt-nix = {
|
|
|
|
url = "github:numtide/treefmt-nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-04 18:00:00 +01:00
|
|
|
outputs = inputs @ { flake-parts, nixpkgs, ... }:
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; }
|
|
|
|
{
|
|
|
|
systems = [
|
|
|
|
"aarch64-darwin"
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"x86_64-linux"
|
|
|
|
];
|
|
|
|
|
|
|
|
imports =
|
|
|
|
let
|
|
|
|
inherit (nixpkgs) lib;
|
|
|
|
moduleDir = ./flake;
|
|
|
|
in
|
|
|
|
with lib; mapAttrsToList (n: _: moduleDir + "/${n}")
|
|
|
|
(filterAttrs
|
|
|
|
(name: type:
|
|
|
|
type == "directory" && builtins.pathExists "${builtins.toString moduleDir}/${name}/default.nix")
|
|
|
|
(builtins.readDir moduleDir));
|
|
|
|
};
|
2023-12-09 18:00:00 +01:00
|
|
|
}
|