diff options
| author | Chris Wells <chris@mathematicaster.org> | 2025-10-22 09:24:40 -0500 |
|---|---|---|
| committer | Chris Wells <chris@mathematicaster.org> | 2025-10-22 09:24:40 -0500 |
| commit | 8d2ef7b4634ea4c2b9f2998ad2121813dcd6859d (patch) | |
| tree | c7e290745646f2e6d7b80c797106c4817314aa35 /modules/flake-module.nix | |
| download | weznix-8d2ef7b4634ea4c2b9f2998ad2121813dcd6859d.tar weznix-8d2ef7b4634ea4c2b9f2998ad2121813dcd6859d.tar.gz weznix-8d2ef7b4634ea4c2b9f2998ad2121813dcd6859d.tar.bz2 weznix-8d2ef7b4634ea4c2b9f2998ad2121813dcd6859d.tar.lz weznix-8d2ef7b4634ea4c2b9f2998ad2121813dcd6859d.tar.xz weznix-8d2ef7b4634ea4c2b9f2998ad2121813dcd6859d.tar.zst weznix-8d2ef7b4634ea4c2b9f2998ad2121813dcd6859d.zip | |
Fixed up the code
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; + }; + }; + }; + }); +} |
