1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-01 07:29:46 +01:00

zig: add module programs.zig

This commit is contained in:
Luis Quiñones 2024-01-12 18:05:20 -05:00
parent 93e804e7f8
commit 97df8d8cc1
3 changed files with 54 additions and 0 deletions

View file

@ -465,6 +465,12 @@
github = "liyangau"; github = "liyangau";
githubId = 71299093; githubId = 71299093;
}; };
luisnquin = {
name = "Luis Quiñones";
email = "lpaandres2020@gmail.com";
github = "luisnquin";
githubId = 86449787;
};
wcarlsen = { wcarlsen = {
name = "Willi Carlsen"; name = "Willi Carlsen";
email = "carlsenwilli+nix@gmail.com"; email = "carlsenwilli+nix@gmail.com";

View file

@ -245,6 +245,7 @@ let
./programs/z-lua.nix ./programs/z-lua.nix
./programs/zathura.nix ./programs/zathura.nix
./programs/zellij.nix ./programs/zellij.nix
./programs/zig.nix
./programs/zoxide.nix ./programs/zoxide.nix
./programs/zplug.nix ./programs/zplug.nix
./programs/zsh.nix ./programs/zsh.nix

47
modules/programs/zig.nix Normal file
View file

@ -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 Zigs 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";
};
}];
};
}