cuemata/flake.nix

47 lines
1.1 KiB
Nix
Raw Normal View History

# SPDX-FileCopyrightText: 2023 Hoang Nguyen <folliekazetani@protonmail.com>
#
# SPDX-License-Identifier: Apache-2.0
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
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));
};
}