Files
dendritic-tutorial/modules/features/zsh/default.nix

54 lines
1.0 KiB
Nix

{
inputs,
moduleWithSystem,
...
}: {
flake.nixosModules.zsh = moduleWithSystem ({
pkgs,
self',
...
}: {config, ...}: let
lib = pkgs.lib;
in {
imports = [];
options = {
enableHighlighting = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable syntax highlighting";
};
};
config = {
nixpkgs.overlays = [
(final: prev: {
zsh = self'.packages.zsh;
})
];
programs.zsh = {
enable = true;
enableSyntaxHighlighting = config.enableHighlighting;
};
};
});
perSystem = {
pkgs,
unstablePkgs,
inputs',
lib,
...
}: {
packages.zsh = inputs.wrappers.wrappers.zsh.wrap {
inherit pkgs;
zshAliases = {
some = lib.getExe unstablePkgs.vim;
v = lib.getExe inputs'.nvim.packages.default;
ff = lib.getExe pkgs.fastfetch;
cat = lib.getExe pkgs.bat;
};
zshrc.content = ''
export SOME=some
'';
};
};
}