nixfiles/util.nix

16 lines
480 B
Nix

{ lib }:
let
inherit (lib) genAttrs mapAttrs' types mkOption;
inherit (lib.flake) defaultSystems;
in {
addPrefix = prefix: mapAttrs' (n: v: { name = "${prefix}${n}"; value = v; });
mkPkgs = path: args: genAttrs defaultSystems (system: import path (args // { inherit system; }));
mkOpt = type: default: mkOption { inherit type default; };
mkBoolOpt = default: mkOption {
inherit default;
type = types.bool;
example = true;
};
}