diff options
Diffstat (limited to 'modules/flake-module.nix')
| -rw-r--r-- | modules/flake-module.nix | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/modules/flake-module.nix b/modules/flake-module.nix new file mode 100644 index 0000000..c43be76 --- /dev/null +++ b/modules/flake-module.nix @@ -0,0 +1,51 @@ +{ lib, flake-parts-lib, inputs, ... }: +let + inherit (lib) mkOption mkPackageOption types; + inherit (flake-parts-lib) mkPerSystemOptions; +in { + perSystem = mkPerSystemOptions ({ pkgs, config, ... }: { + options = { + weznix = { + wezterm = mkPackageOption pkgs "wezterm" {}; + configDirectory = mkOption { + type = types.str; + default = "~/.config/wezterm"; + }; + luaPath = mkOption { + type = types.path; + description = "Path to wezterm config directory"; + }; + wrapConfig = mkOption { + type = types.either types.bool types.str; + default = "WEZDEV"; + }; + extraPATH = mkOption { + type = types.listOf types.package; + default = []; + description = "Extra packages to add to wezterm's $PATH"; + }; + extraWrapperArgs = mkOption { + type = types.listOf types.str; + default = []; + description = "Extra arguments to pass to `wrapProgram`"; + }; + pass = mkOption { + type = types.lazyAttrsOf types.anything; + default = {}; + description = "Anything else to pass into the lua config"; + }; + }; + }; + + config = { + packages = { + weznix = pkgs.callPackage ./pkgs/weznix.nix { + inherit (config.weznix) wezterm; + nixToLua = import inputs.nixToLua; + } { + inherit (config.weznix) configDirectory luaPath wrapConfig extraPATH extraWrapperArgs pass; + }; + }; + }; + }); +} |
