redesign module hierarchy
This commit is contained in:
parent
b1b1743414
commit
d891a92357
22 changed files with 244 additions and 967 deletions
|
|
@ -1,52 +1,26 @@
|
|||
{ config, lib, flake-parts-lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
filterAttrs
|
||||
mapAttrs
|
||||
{
|
||||
lib,
|
||||
snow,
|
||||
...
|
||||
}: let
|
||||
inherit
|
||||
(lib)
|
||||
mkOption
|
||||
optionalAttrs
|
||||
types
|
||||
;
|
||||
inherit (flake-parts-lib)
|
||||
mkPerSystemOption
|
||||
inherit
|
||||
(snow)
|
||||
mkPerSystemFlakeOutput
|
||||
;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
flake.formatter = mkOption {
|
||||
type = types.lazyAttrsOf types.package;
|
||||
default = { };
|
||||
mkPerSystemFlakeOutput {
|
||||
name = "formatter";
|
||||
option = mkOption {
|
||||
type = types.nullOr types.package;
|
||||
default = null;
|
||||
description = ''
|
||||
An attribute set of per system a package used by [`nix fmt`](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-fmt.html).
|
||||
A package used by [`nix fmt`](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-fmt.html).
|
||||
'';
|
||||
};
|
||||
|
||||
perSystem = mkPerSystemOption {
|
||||
_file = ./formatter.nix;
|
||||
options = {
|
||||
formatter = mkOption {
|
||||
type = types.nullOr types.package;
|
||||
default = null;
|
||||
description = ''
|
||||
A package used by [`nix fmt`](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-fmt.html).
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
config = {
|
||||
flake.formatter =
|
||||
mapAttrs
|
||||
(k: v: v.formatter)
|
||||
(filterAttrs
|
||||
(k: v: v.formatter != null)
|
||||
config.allSystems
|
||||
);
|
||||
|
||||
perInput = system: flake:
|
||||
optionalAttrs (flake?formatter.${system}) {
|
||||
formatter = flake.formatter.${system};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
file = ./apps.nix;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue