From 8d2ef7b4634ea4c2b9f2998ad2121813dcd6859d Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Wed, 22 Oct 2025 09:24:40 -0500 Subject: Fixed up the code --- modules/flake-module.nix | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 modules/flake-module.nix (limited to 'modules/flake-module.nix') 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; + }; + }; + }; + }); +} -- cgit v1.2.3