diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index e75541d93..3f48406b1 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -465,6 +465,12 @@ github = "liyangau"; githubId = 71299093; }; + luisnquin = { + name = "Luis Quiñones"; + email = "lpaandres2020@gmail.com"; + github = "luisnquin"; + githubId = 86449787; + }; wcarlsen = { name = "Willi Carlsen"; email = "carlsenwilli+nix@gmail.com"; diff --git a/modules/modules.nix b/modules/modules.nix index 16b7837bf..f6cb391a9 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -245,6 +245,7 @@ let ./programs/z-lua.nix ./programs/zathura.nix ./programs/zellij.nix + ./programs/zig.nix ./programs/zoxide.nix ./programs/zplug.nix ./programs/zsh.nix diff --git a/modules/programs/zig.nix b/modules/programs/zig.nix new file mode 100644 index 000000000..2e46f0f76 --- /dev/null +++ b/modules/programs/zig.nix @@ -0,0 +1,47 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + + cfg = config.programs.zig; + +in { + meta.maintainers = [ maintainers.luisnquin ]; + + options = { + programs.zig = { + enable = mkEnableOption "zig"; + + package = mkOption pkgs { + type = types.package; + default = pkgs.zig; + defaultText = literalExpression "pkgs.zig"; + description = "The Zig package to use."; + }; + + enableZshIntegration = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable Zig’s Zsh integration. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + + programs.zsh.plugins = mkIf cfg.enableZshIntegration [{ + name = "zig-zsh-completions-plugin"; + file = "zig-shell-completions.plugin.zsh"; + src = pkgs.fetchFromGitHub { + owner = "ziglang"; + repo = "shell-completions"; + rev = "31d3ad12890371bf467ef7143f5c2f31cfa7b7c1"; + sha256 = "1fzl1x56b4m11wajk1az4p24312z7wlj2cqa3b519v30yz9clgr0"; + }; + }]; + }; +}